Skip to content

Commit ca68d08

Browse files
Merge #312: scalar: Add SECP256K1_SCALAR_VERIFY to zkp-specific function
96a415b scalar: Port bitcoin-core/secp256k1#1393 to zkp-specific code (mllwchrry) Pull request description: Add the `SECP256K1_SCALAR_VERIFY` macro to the zkp-specific `secp256k1_scalar_set_u64` function. This was missed when upstream PRs bitcoin-core/secp256k1#1373 and bitcoin-core/secp256k1#1393 were merged. ACKs for top commit: real-or-random: ACK 96a415b Tree-SHA512: 4c3c6209e4c27bec7afc07398c9fc50aef7d44850fbbf5969ff4b57991279960c9645c8daeee5d78bee54dac7fe85bc3d9a01ba4b9deb761d574ae6221ef41c1
2 parents 36a7b87 + 96a415b commit ca68d08

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/scalar_4x64_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint6
5151
r->d[1] = 0;
5252
r->d[2] = 0;
5353
r->d[3] = 0;
54+
55+
SECP256K1_SCALAR_VERIFY(r);
5456
}
5557

5658
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {

src/scalar_8x32_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint6
7373
r->d[5] = 0;
7474
r->d[6] = 0;
7575
r->d[7] = 0;
76+
77+
SECP256K1_SCALAR_VERIFY(r);
7678
}
7779

7880
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {

src/scalar_low_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsig
3030
SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint64_t v) {
3131
*r = v % EXHAUSTIVE_TEST_ORDER;
3232

33-
secp256k1_scalar_verify(r);
33+
SECP256K1_SCALAR_VERIFY(r);
3434
}
3535

3636
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {

0 commit comments

Comments
 (0)