Fix secp256k1 build

This commit is contained in:
Hector Chu 2024-03-03 11:43:45 +00:00 committed by losh11
parent 2170c245ee
commit a7b5cd6b51
No known key found for this signature in database
GPG Key ID: 3B2A6315CD51A673
3 changed files with 8 additions and 6 deletions

View File

@ -220,6 +220,11 @@ static void secp256k1_scalar_inverse(secp256k1_scalar *r, const secp256k1_scalar
secp256k1_scalar_mul(r, t, &x6); /* 111111 */
}
SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) {
return !(a->d[0] & 1);
}
#endif
static int secp256k1_scalar_set_b32_seckey(secp256k1_scalar* r, const unsigned char* bin)
{
int overflow;
@ -227,11 +232,6 @@ static int secp256k1_scalar_set_b32_seckey(secp256k1_scalar* r, const unsigned c
return (!overflow) & (!secp256k1_scalar_is_zero(r));
}
SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) {
return !(a->d[0] & 1);
}
#endif
static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *x) {
#if defined(USE_SCALAR_INV_BUILTIN)
secp256k1_scalar_inverse(r, x);

View File

@ -12,4 +12,6 @@
/** A scalar modulo the group order of the secp256k1 curve. */
typedef uint32_t secp256k1_scalar;
#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) (d0)
#endif /* SECP256K1_SCALAR_REPR_H */

View File

@ -4426,6 +4426,7 @@ int test_ecdsa_der_parse(const unsigned char *sig, size_t siglen, int certainly_
ret |= (!parsed_der_lax) << 16;
}
return ret;
#ifdef ENABLE_OPENSSL_TESTS
sig_openssl = ECDSA_SIG_new();
sigptr = sig;
@ -4463,7 +4464,6 @@ int test_ecdsa_der_parse(const unsigned char *sig, size_t siglen, int certainly_
ret |= (memcmp(roundtrip_der, roundtrip_openssl, len_der) != 0) << 9;
}
#endif
return ret;
}
static void assign_big_endian(unsigned char *ptr, size_t ptrlen, uint32_t val) {