scalar: Port bitcoin-core/secp256k1#1393 to zkp-specific code
This commit is contained in:
@@ -51,6 +51,8 @@ SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint6
|
|||||||
r->d[1] = 0;
|
r->d[1] = 0;
|
||||||
r->d[2] = 0;
|
r->d[2] = 0;
|
||||||
r->d[3] = 0;
|
r->d[3] = 0;
|
||||||
|
|
||||||
|
SECP256K1_SCALAR_VERIFY(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint6
|
|||||||
r->d[5] = 0;
|
r->d[5] = 0;
|
||||||
r->d[6] = 0;
|
r->d[6] = 0;
|
||||||
r->d[7] = 0;
|
r->d[7] = 0;
|
||||||
|
|
||||||
|
SECP256K1_SCALAR_VERIFY(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ SECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsig
|
|||||||
SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint64_t v) {
|
SECP256K1_INLINE static void secp256k1_scalar_set_u64(secp256k1_scalar *r, uint64_t v) {
|
||||||
*r = v % EXHAUSTIVE_TEST_ORDER;
|
*r = v % EXHAUSTIVE_TEST_ORDER;
|
||||||
|
|
||||||
secp256k1_scalar_verify(r);
|
SECP256K1_SCALAR_VERIFY(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
|
||||||
|
|||||||
Reference in New Issue
Block a user