Skip to content

Commit b657f53

Browse files
committed
Remove unnecessary VERIFY_CHECK guards
1 parent 2033db0 commit b657f53

5 files changed

+0
-14
lines changed

src/field_10x26_impl.h

-4
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,7 @@ void secp256k1_fe_sqr_inner(uint32_t *r, const uint32_t *a);
453453

454454
#else
455455

456-
#ifdef VERIFY
457456
#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)
458-
#else
459-
#define VERIFY_BITS(x, n) do { } while(0)
460-
#endif
461457

462458
SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint32_t *r, const uint32_t *a, const uint32_t * SECP256K1_RESTRICT b) {
463459
uint64_t c, d;

src/field_5x52_int128_impl.h

-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99

1010
#include <stdint.h>
1111

12-
#ifdef VERIFY
1312
#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)
14-
#else
15-
#define VERIFY_BITS(x, n) do { } while(0)
16-
#endif
1713

1814
SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) {
1915
uint128_t c, d;

src/scalar_4x64_impl.h

-2
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int
108108
r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;
109109
t += (uint128_t)r->d[3] + (((uint64_t)((bit >> 6) == 3)) << (bit & 0x3F));
110110
r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL;
111-
#ifdef VERIFY
112111
VERIFY_CHECK((t >> 64) == 0);
113112
VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
114-
#endif
115113
}
116114

117115
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {

src/scalar_8x32_impl.h

-2
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int
156156
r->d[6] = t & 0xFFFFFFFFULL; t >>= 32;
157157
t += (uint64_t)r->d[7] + (((uint32_t)((bit >> 5) == 7)) << (bit & 0x1F));
158158
r->d[7] = t & 0xFFFFFFFFULL;
159-
#ifdef VERIFY
160159
VERIFY_CHECK((t >> 32) == 0);
161160
VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
162-
#endif
163161
}
164162

165163
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {

src/scalar_low_impl.h

-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a,
3939
static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {
4040
if (flag && bit < 32)
4141
*r += ((uint32_t)1 << bit);
42-
#ifdef VERIFY
4342
VERIFY_CHECK(bit < 32);
4443
/* Verify that adding (1 << bit) will not overflow any in-range scalar *r by overflowing the underlying uint32_t. */
4544
VERIFY_CHECK(((uint32_t)1 << bit) - 1 <= UINT32_MAX - EXHAUSTIVE_TEST_ORDER);
4645
VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
47-
#endif
4846
}
4947

5048
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {

0 commit comments

Comments
 (0)