From b0f07732216abdb96c988402a77f415250056071 Mon Sep 17 00:00:00 2001 From: Gregor Date: Tue, 19 Dec 2023 12:20:55 +0100 Subject: [PATCH] minor improvement --- src/lib/crypto/kimchi_backend/common/field.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/crypto/kimchi_backend/common/field.ml b/src/lib/crypto/kimchi_backend/common/field.ml index f4907788fee..1f864f90511 100644 --- a/src/lib/crypto/kimchi_backend/common/field.ml +++ b/src/lib/crypto/kimchi_backend/common/field.ml @@ -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