Skip to content

Commit dcdda31

Browse files
Tighten secp256k1_fe_mul_inner's VERIFY_BITS checks
These changes bring the checks to the same values used at the corresponding positions in secp256k1_fe_sqr_inner.
1 parent 8e2a5fe commit dcdda31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/field_5x52_int128_impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t
8989
secp256k1_u128_accum_mul(&d, a2, b[3]);
9090
secp256k1_u128_accum_mul(&d, a3, b[2]);
9191
secp256k1_u128_accum_mul(&d, a4, b[1]);
92-
VERIFY_BITS_128(&d, 115);
92+
VERIFY_BITS_128(&d, 114);
9393
/* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
9494
u0 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
9595
VERIFY_BITS(u0, 52);
96-
VERIFY_BITS_128(&d, 63);
96+
VERIFY_BITS_128(&d, 62);
9797
/* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
9898
/* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
9999
u0 = (u0 << 4) | tx;

0 commit comments

Comments
 (0)