6 #ifndef SECP256K1_TESTUTIL_H 7 #define SECP256K1_TESTUTIL_H 16 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
17 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
18 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
19 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41
23 unsigned char bin[32];
50 CHECK(fe->magnitude == n);
55 unsigned char bin[32];
122 unsigned char b32[32];
135 unsigned char b32[32];
This field implementation represents the value as 10 uint32_t limbs in base 2^26. ...
#define secp256k1_fe_set_b32_limit
static void testutil_random_ge_test(secp256k1_ge *ge)
static void testutil_random_scalar_order_b32(unsigned char *b32)
#define secp256k1_fe_is_zero
static const unsigned char secp256k1_group_order_bytes[32]
#define secp256k1_fe_mul_int_unchecked
static void testutil_random_pubkey_test(secp256k1_pubkey *pk)
#define SECP256K1_GEJ_Z_MAGNITUDE_MAX
static void testutil_random_ge_y_magnitude(secp256k1_ge *ge)
static int secp256k1_scalar_is_zero(const secp256k1_scalar *a)
Check whether a scalar equals zero.
static void secp256k1_pubkey_save(secp256k1_pubkey *pubkey, secp256k1_ge *ge)
static void testrand256_test(unsigned char *b32)
Generate a pseudorandom 32-byte array with long sequences of zero and one bits.
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow)
Set a scalar from a big endian byte array.
A group element of the secp256k1 curve, in jacobian coordinates.
static void testrand256(unsigned char *b32)
Generate a pseudorandom 32-byte array.
static void testutil_random_fe_test(secp256k1_fe *x)
static void testutil_random_gej_test(secp256k1_gej *gej)
#define SECP256K1_GEJ_X_MAGNITUDE_MAX
static void testutil_random_gej_x_magnitude(secp256k1_gej *gej)
static void testutil_random_scalar_order(secp256k1_scalar *num)
#define CHECK(cond)
Unconditional failure on condition failure.
static void testutil_random_fe(secp256k1_fe *x)
#define secp256k1_fe_set_int
A group element in affine coordinates on the secp256k1 curve, or occasionally on an isomorphic curve ...
static void testutil_random_gej_z_magnitude(secp256k1_gej *gej)
A scalar modulo the group order of the secp256k1 curve.
static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar *a)
Convert a scalar to a byte array.
static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd)
Set a group element (affine) equal to the point with the given X coordinate, and given oddness for Y...
static uint32_t testrand_int(uint32_t range)
Generate a pseudorandom number in the range [0..range-1].
static void testutil_random_ge_jacobian_test(secp256k1_gej *gej, const secp256k1_ge *ge)
#define SECP256K1_GE_X_MAGNITUDE_MAX
Maximum allowed magnitudes for group element coordinates in affine (x, y) and jacobian (x...
static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b)
Rescale a jacobian point by b which must be non-zero.
#define SECP256K1_GEJ_Y_MAGNITUDE_MAX
static void testutil_random_ge_x_magnitude(secp256k1_ge *ge)
static void testutil_random_fe_non_zero_test(secp256k1_fe *fe)
static void testutil_random_fe_non_zero(secp256k1_fe *nz)
#define secp256k1_fe_normalize
#define SECP256K1_GE_Y_MAGNITUDE_MAX
static SECP256K1_INLINE uint64_t testrand_bits(int bits)
Generate a pseudorandom number in the range [0..2**bits-1].
#define secp256k1_fe_negate(r, a, m)
Negate a field element.
static void testutil_random_scalar_order_test(secp256k1_scalar *num)
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a)
Set a group element (jacobian) equal to another which is given in affine coordinates.
static void testutil_random_gej_y_magnitude(secp256k1_gej *gej)
static void testutil_random_fe_magnitude(secp256k1_fe *fe, int m)
Opaque data structure that holds a parsed and valid public key.