Skip to content

Commit 96a415b

Browse files
committed
scalar: Port bitcoin-core/secp256k1#1393 to zkp-specific code
1 parent 36a7b87 commit 96a415b

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)