Skip to content

Commit

Permalink
minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Dec 19, 2023
1 parent 64b9990 commit b0f0773
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/crypto/kimchi_backend/common/field.ml
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ module Make (F : Input_intf) :
let two_to_32 = Bignum_bigint.of_int64 4294967296L

let to_bignum_bigint n =
let result = ref Bignum_bigint.zero in
for i = 7 downto 0 do
let result = ref (Bignum_bigint.of_int (Bigint.test_uint32 n 7)) in
for i = 6 downto 0 do
let ni = Bignum_bigint.of_int (Bigint.test_uint32 n i) in
result := Bignum_bigint.(ni + (!result * two_to_32))
result := Bignum_bigint.(ni + (two_to_32 * !result))
done ;
!result

Expand Down

0 comments on commit b0f0773

Please sign in to comment.