Bitcoin ABC 0.30.7
P2P Digital Currency
Classes | Macros | Functions | Variables
tests.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "secp256k1.c"
#include "include/secp256k1.h"
#include "include/secp256k1_preallocated.h"
#include "testrand_impl.h"
#include "util.h"
#include "contrib/lax_der_parsing.c"
#include "contrib/lax_der_privatekey_parsing.c"
#include "modinv32_impl.h"
Include dependency graph for tests.c:

Go to the source code of this file.

Classes

struct  ecmult_multi_data
 

Macros

#define SECP256K1_EC_PARSE_TEST_NVALID   (12)
 
#define SECP256K1_EC_PARSE_TEST_NXVALID   (4)
 
#define SECP256K1_EC_PARSE_TEST_NINVALID   (7)
 

Functions

static void counting_illegal_callback_fn (const char *str, void *data)
 
static void uncounting_illegal_callback_fn (const char *str, void *data)
 
void random_field_element_test (secp256k1_fe *fe)
 
void random_field_element_magnitude (secp256k1_fe *fe)
 
void random_group_element_test (secp256k1_ge *ge)
 
void random_group_element_jacobian_test (secp256k1_gej *gej, const secp256k1_ge *ge)
 
void random_scalar_order_test (secp256k1_scalar *num)
 
void random_scalar_order (secp256k1_scalar *num)
 
void random_scalar_order_b32 (unsigned char *b32)
 
void run_context_tests (int use_prealloc)
 
void run_scratch_tests (void)
 
void run_ctz_tests (void)
 
void run_sha256_tests (void)
 
void run_hmac_sha256_tests (void)
 
void run_rfc6979_hmac_sha256_tests (void)
 
void run_tagged_sha256_tests (void)
 
void test_rand_bits (int rand32, int bits)
 
void test_rand_int (uint32_t range, uint32_t subrange)
 
void run_rand_bits (void)
 
void run_rand_int (void)
 
uint64_t modinv2p64 (uint64_t x)
 
void mulmod256 (uint16_t *out, const uint16_t *a, const uint16_t *b, const uint16_t *m)
 
void uint16_to_signed30 (secp256k1_modinv32_signed30 *out, const uint16_t *in)
 
void signed30_to_uint16 (uint16_t *out, const secp256k1_modinv32_signed30 *in)
 
void mutate_sign_signed30 (secp256k1_modinv32_signed30 *x)
 
void test_modinv32_uint16 (uint16_t *out, const uint16_t *in, const uint16_t *mod)
 
int coprime (const uint16_t *a, const uint16_t *b)
 
void run_modinv_tests (void)
 
void scalar_test (void)
 
void run_scalar_set_b32_seckey_tests (void)
 
void run_scalar_tests (void)
 
void random_fe (secp256k1_fe *x)
 
void random_fe_test (secp256k1_fe *x)
 
void random_fe_non_zero (secp256k1_fe *nz)
 
void random_fe_non_square (secp256k1_fe *ns)
 
int check_fe_equal (const secp256k1_fe *a, const secp256k1_fe *b)
 
void run_field_convert (void)
 
int fe_secp256k1_memcmp_var (const secp256k1_fe *a, const secp256k1_fe *b)
 
void run_field_misc (void)
 
void run_sqr (void)
 
void test_sqrt (const secp256k1_fe *a, const secp256k1_fe *k)
 
void run_sqrt (void)
 
void test_inverse_scalar (secp256k1_scalar *out, const secp256k1_scalar *x, int var)
 
void test_inverse_field (secp256k1_fe *out, const secp256k1_fe *x, int var)
 
void run_inverse_tests (void)
 
void ge_equals_ge (const secp256k1_ge *a, const secp256k1_ge *b)
 
int gej_xyz_equals_gej (const secp256k1_gej *a, const secp256k1_gej *b)
 
void ge_equals_gej (const secp256k1_ge *a, const secp256k1_gej *b)
 
void test_ge (void)
 
void test_intialized_inf (void)
 
void test_add_neg_y_diff_x (void)
 
void run_ge (void)
 
void test_ec_combine (void)
 
void run_ec_combine (void)
 
void test_group_decompress (const secp256k1_fe *x)
 
void run_group_decompress (void)
 
void run_ecmult_chain (void)
 
void test_point_times_order (const secp256k1_gej *point)
 
void test_ecmult_target (const secp256k1_scalar *target, int mode)
 
void run_ecmult_near_split_bound (void)
 
void run_point_times_order (void)
 
void ecmult_const_random_mult (void)
 
void ecmult_const_commutativity (void)
 
void ecmult_const_mult_zero_one (void)
 
void ecmult_const_chain_multiply (void)
 
void run_ecmult_const_tests (void)
 
static int ecmult_multi_callback (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *cbdata)
 
static int ecmult_multi_false_callback (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *cbdata)
 
void test_ecmult_multi (secp256k1_scratch *scratch, secp256k1_ecmult_multi_func ecmult_multi)
 
void test_ecmult_multi_batch_single (secp256k1_ecmult_multi_func ecmult_multi)
 
void test_secp256k1_pippenger_bucket_window_inv (void)
 
void test_ecmult_multi_pippenger_max_points (void)
 Probabilistically test the function returning the maximum number of possible points for a given scratch space. More...
 
void test_ecmult_multi_batch_size_helper (void)
 
void test_ecmult_multi_batching (void)
 Run secp256k1_ecmult_multi_var with num points and a scratch space restricted to 1 <= i <= num points. More...
 
void run_ecmult_multi_tests (void)
 
void test_wnaf (const secp256k1_scalar *number, int w)
 
void test_constant_wnaf_negate (const secp256k1_scalar *number)
 
void test_constant_wnaf (const secp256k1_scalar *number, int w)
 
void test_fixed_wnaf (const secp256k1_scalar *number, int w)
 
void test_fixed_wnaf_small_helper (int *wnaf, int *wnaf_expected, int w)
 
void test_fixed_wnaf_small (void)
 
void run_wnaf (void)
 
void test_ecmult_constants (void)
 
void run_ecmult_constants (void)
 
void test_ecmult_gen_blind (void)
 
void test_ecmult_gen_blind_reset (void)
 
void run_ecmult_gen_blind (void)
 
void test_scalar_split (const secp256k1_scalar *full)
 
void run_endomorphism_tests (void)
 
void ec_pubkey_parse_pointtest (const unsigned char *input, int xvalid, int yvalid)
 
void run_ec_pubkey_parse_test (void)
 
void run_eckey_edge_case_test (void)
 
void run_eckey_negate_test (void)
 
void random_sign (secp256k1_scalar *sigr, secp256k1_scalar *sigs, const secp256k1_scalar *key, const secp256k1_scalar *msg, int *recid)
 
void test_ecdsa_sign_verify (void)
 
void run_ecdsa_sign_verify (void)
 
static int precomputed_nonce_function (unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter)
 Dummy nonce generation function that just uses a precomputed nonce, and fails if it is not accepted. More...
 
static int nonce_function_test_fail (unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter)
 
static int nonce_function_test_retry (unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter)
 
int is_empty_signature (const secp256k1_ecdsa_signature *sig)
 
void test_ecdsa_end_to_end (void)
 
void test_random_pubkeys (void)
 
void run_pubkey_comparison (void)
 
void run_random_pubkeys (void)
 
void run_ecdsa_end_to_end (void)
 
int test_ecdsa_der_parse (const unsigned char *sig, size_t siglen, int certainly_der, int certainly_not_der)
 
static void assign_big_endian (unsigned char *ptr, size_t ptrlen, uint32_t val)
 
static void damage_array (unsigned char *sig, size_t *len)
 
static void random_ber_signature (unsigned char *sig, size_t *len, int *certainly_der, int *certainly_not_der)
 
void run_ecdsa_der_parse (void)
 
void test_ecdsa_edge_cases (void)
 
void run_ecdsa_edge_cases (void)
 
void run_secp256k1_memczero_test (void)
 
void int_cmov_test (void)
 
void fe_cmov_test (void)
 
void fe_storage_cmov_test (void)
 
void scalar_cmov_test (void)
 
void ge_storage_cmov_test (void)
 
void run_cmov_tests (void)
 
int main (int argc, char **argv)
 

Variables

static int count = 64
 
static secp256k1_contextctx = NULL
 
static const secp256k1_scalar scalar_minus_one
 
static const secp256k1_fe fe_minus_one
 
static const secp256k1_scalar scalars_near_split_bounds [20]
 

Macro Definition Documentation

◆ SECP256K1_EC_PARSE_TEST_NINVALID

#define SECP256K1_EC_PARSE_TEST_NINVALID   (7)

◆ SECP256K1_EC_PARSE_TEST_NVALID

#define SECP256K1_EC_PARSE_TEST_NVALID   (12)

◆ SECP256K1_EC_PARSE_TEST_NXVALID

#define SECP256K1_EC_PARSE_TEST_NXVALID   (4)

Function Documentation

◆ assign_big_endian()

static void assign_big_endian ( unsigned char *  ptr,
size_t  ptrlen,
uint32_t  val 
)
static

Definition at line 4987 of file tests.c.

Here is the caller graph for this function:

◆ check_fe_equal()

int check_fe_equal ( const secp256k1_fe a,
const secp256k1_fe b 
)

Definition at line 1930 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coprime()

int coprime ( const uint16_t *  a,
const uint16_t *  b 
)

Definition at line 906 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counting_illegal_callback_fn()

static void counting_illegal_callback_fn ( const char *  str,
void *  data 
)
static

Definition at line 34 of file tests.c.

Here is the caller graph for this function:

◆ damage_array()

static void damage_array ( unsigned char *  sig,
size_t *  len 
)
static

Definition at line 4999 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_pubkey_parse_pointtest()

void ec_pubkey_parse_pointtest ( const unsigned char *  input,
int  xvalid,
int  yvalid 
)

Definition at line 3872 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecmult_const_chain_multiply()

void ecmult_const_chain_multiply ( void  )

Definition at line 3005 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecmult_const_commutativity()

void ecmult_const_commutativity ( void  )

Definition at line 2962 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecmult_const_mult_zero_one()

void ecmult_const_mult_zero_one ( void  )

Definition at line 2983 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecmult_const_random_mult()

void ecmult_const_random_mult ( void  )

Definition at line 2935 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecmult_multi_callback()

static int ecmult_multi_callback ( secp256k1_scalar sc,
secp256k1_ge pt,
size_t  idx,
void *  cbdata 
)
static

Definition at line 3043 of file tests.c.

Here is the caller graph for this function:

◆ ecmult_multi_false_callback()

static int ecmult_multi_false_callback ( secp256k1_scalar sc,
secp256k1_ge pt,
size_t  idx,
void *  cbdata 
)
static

Definition at line 3050 of file tests.c.

Here is the caller graph for this function:

◆ fe_cmov_test()

void fe_cmov_test ( void  )

Definition at line 5641 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fe_secp256k1_memcmp_var()

int fe_secp256k1_memcmp_var ( const secp256k1_fe a,
const secp256k1_fe b 
)

Definition at line 1968 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fe_storage_cmov_test()

void fe_storage_cmov_test ( void  )

Definition at line 5671 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ge_equals_ge()

void ge_equals_ge ( const secp256k1_ge a,
const secp256k1_ge b 
)

Definition at line 2286 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ge_equals_gej()

void ge_equals_gej ( const secp256k1_ge a,
const secp256k1_gej b 
)

Definition at line 2317 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ge_storage_cmov_test()

void ge_storage_cmov_test ( void  )

Definition at line 5731 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gej_xyz_equals_gej()

int gej_xyz_equals_gej ( const secp256k1_gej a,
const secp256k1_gej b 
)

Definition at line 2296 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ int_cmov_test()

void int_cmov_test ( void  )

Definition at line 5616 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_empty_signature()

int is_empty_signature ( const secp256k1_ecdsa_signature sig)

Definition at line 4654 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 5771 of file tests.c.

◆ modinv2p64()

uint64_t modinv2p64 ( uint64_t  x)

Definition at line 664 of file tests.c.

Here is the caller graph for this function:

◆ mulmod256()

void mulmod256 ( uint16_t *  out,
const uint16_t *  a,
const uint16_t *  b,
const uint16_t *  m 
)

Definition at line 680 of file tests.c.

Here is the caller graph for this function:

◆ mutate_sign_signed30()

void mutate_sign_signed30 ( secp256k1_modinv32_signed30 x)

Definition at line 780 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nonce_function_test_fail()

static int nonce_function_test_fail ( unsigned char *  nonce32,
const unsigned char *  msg32,
const unsigned char *  key32,
const unsigned char *  algo16,
void *  data,
unsigned int  counter 
)
static

Definition at line 4616 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nonce_function_test_retry()

static int nonce_function_test_retry ( unsigned char *  nonce32,
const unsigned char *  msg32,
const unsigned char *  key32,
const unsigned char *  algo16,
void *  data,
unsigned int  counter 
)
static

Definition at line 4624 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ precomputed_nonce_function()

static int precomputed_nonce_function ( unsigned char *  nonce32,
const unsigned char *  msg32,
const unsigned char *  key32,
const unsigned char *  algo16,
void *  data,
unsigned int  counter 
)
static

Dummy nonce generation function that just uses a precomputed nonce, and fails if it is not accepted.

Use only for testing.

Definition at line 4608 of file tests.c.

Here is the caller graph for this function:

◆ random_ber_signature()

static void random_ber_signature ( unsigned char *  sig,
size_t *  len,
int *  certainly_der,
int *  certainly_not_der 
)
static

Definition at line 5026 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_fe()

void random_fe ( secp256k1_fe x)

Definition at line 1889 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_fe_non_square()

void random_fe_non_square ( secp256k1_fe ns)

Definition at line 1922 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_fe_non_zero()

void random_fe_non_zero ( secp256k1_fe nz)

Definition at line 1909 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_fe_test()

void random_fe_test ( secp256k1_fe x)

Definition at line 1899 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_field_element_magnitude()

void random_field_element_magnitude ( secp256k1_fe fe)

Definition at line 60 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_field_element_test()

void random_field_element_test ( secp256k1_fe fe)

Definition at line 50 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_group_element_jacobian_test()

void random_group_element_jacobian_test ( secp256k1_gej gej,
const secp256k1_ge ge 
)

Definition at line 88 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_group_element_test()

void random_group_element_test ( secp256k1_ge ge)

Definition at line 76 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_scalar_order()

void random_scalar_order ( secp256k1_scalar num)

Definition at line 116 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_scalar_order_b32()

void random_scalar_order_b32 ( unsigned char *  b32)

Definition at line 129 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_scalar_order_test()

void random_scalar_order_test ( secp256k1_scalar num)

Definition at line 103 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_sign()

void random_sign ( secp256k1_scalar sigr,
secp256k1_scalar sigs,
const secp256k1_scalar key,
const secp256k1_scalar msg,
int *  recid 
)

Definition at line 4566 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_cmov_tests()

void run_cmov_tests ( void  )

Definition at line 5763 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_context_tests()

void run_context_tests ( int  use_prealloc)

Definition at line 135 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ctz_tests()

void run_ctz_tests ( void  )

Definition at line 415 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ec_combine()

void run_ec_combine ( void  )

Definition at line 2653 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ec_pubkey_parse_test()

void run_ec_pubkey_parse_test ( void  )

Definition at line 3947 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecdsa_der_parse()

void run_ecdsa_der_parse ( void  )

Definition at line 5172 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecdsa_edge_cases()

void run_ecdsa_edge_cases ( void  )

Definition at line 5573 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecdsa_end_to_end()

void run_ecdsa_end_to_end ( void  )

Definition at line 4920 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecdsa_sign_verify()

void run_ecdsa_sign_verify ( void  )

Definition at line 4600 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_eckey_edge_case_test()

void run_eckey_edge_case_test ( void  )

Definition at line 4275 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_eckey_negate_test()

void run_eckey_negate_test ( void  )

Definition at line 4531 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_chain()

void run_ecmult_chain ( void  )

Definition at line 2735 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_const_tests()

void run_ecmult_const_tests ( void  )

Definition at line 3031 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_constants()

void run_ecmult_constants ( void  )

Definition at line 3776 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_gen_blind()

void run_ecmult_gen_blind ( void  )

Definition at line 3815 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_multi_tests()

void run_ecmult_multi_tests ( void  )

Definition at line 3484 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ecmult_near_split_bound()

void run_ecmult_near_split_bound ( void  )

Definition at line 2902 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_endomorphism_tests()

void run_endomorphism_tests ( void  )

Definition at line 3851 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_field_convert()

void run_field_convert ( void  )

Definition at line 1938 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_field_misc()

void run_field_misc ( void  )

Definition at line 1977 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_ge()

void run_ge ( void  )

Definition at line 2619 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_group_decompress()

void run_group_decompress ( void  )

Definition at line 2724 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_hmac_sha256_tests()

void run_hmac_sha256_tests ( void  )

Definition at line 472 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_inverse_tests()

void run_inverse_tests ( void  )

Definition at line 2187 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_modinv_tests()

void run_modinv_tests ( void  )

Definition at line 936 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_point_times_order()

void run_point_times_order ( void  )

Definition at line 2914 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_pubkey_comparison()

void run_pubkey_comparison ( void  )

Definition at line 4864 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_rand_bits()

void run_rand_bits ( void  )

Definition at line 642 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_rand_int()

void run_rand_int ( void  )

Definition at line 650 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_random_pubkeys()

void run_random_pubkeys ( void  )

Definition at line 4913 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_rfc6979_hmac_sha256_tests()

void run_rfc6979_hmac_sha256_tests ( void  )

Definition at line 516 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_scalar_set_b32_seckey_tests()

void run_scalar_set_b32_seckey_tests ( void  )

Definition at line 1264 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_scalar_tests()

void run_scalar_tests ( void  )

Definition at line 1281 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_scratch_tests()

void run_scratch_tests ( void  )

Definition at line 332 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_secp256k1_memczero_test()

void run_secp256k1_memczero_test ( void  )

Definition at line 5601 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_sha256_tests()

void run_sha256_tests ( void  )

Definition at line 436 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_sqr()

void run_sqr ( void  )

Definition at line 2057 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_sqrt()

void run_sqrt ( void  )

Definition at line 2087 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_tagged_sha256_tests()

void run_tagged_sha256_tests ( void  )

Definition at line 557 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_wnaf()

void run_wnaf ( void  )

Definition at line 3697 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalar_cmov_test()

void scalar_cmov_test ( void  )

Definition at line 5701 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalar_test()

void scalar_test ( void  )

Definition at line 1099 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signed30_to_uint16()

void signed30_to_uint16 ( uint16_t *  out,
const secp256k1_modinv32_signed30 in 
)

Definition at line 771 of file tests.c.

Here is the caller graph for this function:

◆ test_add_neg_y_diff_x()

void test_add_neg_y_diff_x ( void  )

Definition at line 2552 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_constant_wnaf()

void test_constant_wnaf ( const secp256k1_scalar number,
int  w 
)

Definition at line 3556 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_constant_wnaf_negate()

void test_constant_wnaf_negate ( const secp256k1_scalar number)

Definition at line 3541 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ec_combine()

void test_ec_combine ( void  )

Definition at line 2628 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecdsa_der_parse()

int test_ecdsa_der_parse ( const unsigned char *  sig,
size_t  siglen,
int  certainly_der,
int  certainly_not_der 
)

Definition at line 4927 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecdsa_edge_cases()

void test_ecdsa_edge_cases ( void  )

Definition at line 5204 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecdsa_end_to_end()

void test_ecdsa_end_to_end ( void  )

Definition at line 4659 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecdsa_sign_verify()

void test_ecdsa_sign_verify ( void  )

Definition at line 4573 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_constants()

void test_ecmult_constants ( void  )

Definition at line 3743 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_gen_blind()

void test_ecmult_gen_blind ( void  )

Definition at line 3780 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_gen_blind_reset()

void test_ecmult_gen_blind_reset ( void  )

Definition at line 3803 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_multi()

void test_ecmult_multi ( secp256k1_scratch scratch,
secp256k1_ecmult_multi_func  ecmult_multi 
)

Definition at line 3058 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_multi_batch_single()

void test_ecmult_multi_batch_single ( secp256k1_ecmult_multi_func  ecmult_multi)

Definition at line 3296 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_multi_batch_size_helper()

void test_ecmult_multi_batch_size_helper ( void  )

Definition at line 3369 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_multi_batching()

void test_ecmult_multi_batching ( void  )

Run secp256k1_ecmult_multi_var with num points and a scratch space restricted to 1 <= i <= num points.

Definition at line 3417 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_multi_pippenger_max_points()

void test_ecmult_multi_pippenger_max_points ( void  )

Probabilistically test the function returning the maximum number of possible points for a given scratch space.

Definition at line 3336 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ecmult_target()

void test_ecmult_target ( const secp256k1_scalar target,
int  mode 
)

Definition at line 2863 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_fixed_wnaf()

void test_fixed_wnaf ( const secp256k1_scalar number,
int  w 
)

Definition at line 3596 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_fixed_wnaf_small()

void test_fixed_wnaf_small ( void  )

Definition at line 3643 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_fixed_wnaf_small_helper()

void test_fixed_wnaf_small_helper ( int *  wnaf,
int *  wnaf_expected,
int  w 
)

Definition at line 3633 of file tests.c.

Here is the caller graph for this function:

◆ test_ge()

void test_ge ( void  )

Definition at line 2334 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_group_decompress()

void test_group_decompress ( const secp256k1_fe x)

Definition at line 2660 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_intialized_inf()

void test_intialized_inf ( void  )

Definition at line 2520 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_inverse_field()

void test_inverse_field ( secp256k1_fe out,
const secp256k1_fe x,
int  var 
)

Definition at line 2162 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_inverse_scalar()

void test_inverse_scalar ( secp256k1_scalar out,
const secp256k1_scalar x,
int  var 
)

Definition at line 2140 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_modinv32_uint16()

void test_modinv32_uint16 ( uint16_t *  out,
const uint16_t *  in,
const uint16_t *  mod 
)

Definition at line 795 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_point_times_order()

void test_point_times_order ( const secp256k1_gej point)

Definition at line 2799 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_rand_bits()

void test_rand_bits ( int  rand32,
int  bits 
)

Definition at line 591 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_rand_int()

void test_rand_int ( uint32_t  range,
uint32_t  subrange 
)

Definition at line 626 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_random_pubkeys()

void test_random_pubkeys ( void  )

Definition at line 4804 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_scalar_split()

void test_scalar_split ( const secp256k1_scalar full)

Definition at line 3824 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_secp256k1_pippenger_bucket_window_inv()

void test_secp256k1_pippenger_bucket_window_inv ( void  )

Definition at line 3316 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_sqrt()

void test_sqrt ( const secp256k1_fe a,
const secp256k1_fe k 
)

Definition at line 2073 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_wnaf()

void test_wnaf ( const secp256k1_scalar number,
int  w 
)

Definition at line 3507 of file tests.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uint16_to_signed30()

void uint16_to_signed30 ( secp256k1_modinv32_signed30 out,
const uint16_t *  in 
)

Definition at line 762 of file tests.c.

Here is the caller graph for this function:

◆ uncounting_illegal_callback_fn()

static void uncounting_illegal_callback_fn ( const char *  str,
void *  data 
)
static

Definition at line 42 of file tests.c.

Here is the caller graph for this function:

Variable Documentation

◆ count

int count = 64
static

Definition at line 31 of file tests.c.

◆ ctx

secp256k1_context* ctx = NULL
static

Definition at line 32 of file tests.c.

◆ fe_minus_one

const secp256k1_fe fe_minus_one
static
Initial value:
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFC2E
)
#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0)
Definition: field_10x26.h:40

Definition at line 2128 of file tests.c.

◆ scalar_minus_one

const secp256k1_scalar scalar_minus_one
static
Initial value:
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE,
0xBAAEDCE6, 0xAF48A03B, 0xBFD25E8C, 0xD0364140
)
#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0)
Definition: scalar_4x64.h:17

Definition at line 2123 of file tests.c.

◆ scalars_near_split_bounds

const secp256k1_scalar scalars_near_split_bounds[20]
static
Initial value:
= {
SECP256K1_SCALAR_CONST(0xd938a566, 0x7f479e3e, 0xb5b3c7fa, 0xefdb3749, 0x3aa0585c, 0xc5ea2367, 0xe1b660db, 0x0209e6fc),
SECP256K1_SCALAR_CONST(0xd938a566, 0x7f479e3e, 0xb5b3c7fa, 0xefdb3749, 0x3aa0585c, 0xc5ea2367, 0xe1b660db, 0x0209e6fd),
SECP256K1_SCALAR_CONST(0xd938a566, 0x7f479e3e, 0xb5b3c7fa, 0xefdb3749, 0x3aa0585c, 0xc5ea2367, 0xe1b660db, 0x0209e6fe),
SECP256K1_SCALAR_CONST(0xd938a566, 0x7f479e3e, 0xb5b3c7fa, 0xefdb3749, 0x3aa0585c, 0xc5ea2367, 0xe1b660db, 0x0209e6ff),
SECP256K1_SCALAR_CONST(0x2c9c52b3, 0x3fa3cf1f, 0x5ad9e3fd, 0x77ed9ba5, 0xb294b893, 0x3722e9a5, 0x00e698ca, 0x4cf7632d),
SECP256K1_SCALAR_CONST(0x2c9c52b3, 0x3fa3cf1f, 0x5ad9e3fd, 0x77ed9ba5, 0xb294b893, 0x3722e9a5, 0x00e698ca, 0x4cf7632e),
SECP256K1_SCALAR_CONST(0x2c9c52b3, 0x3fa3cf1f, 0x5ad9e3fd, 0x77ed9ba5, 0xb294b893, 0x3722e9a5, 0x00e698ca, 0x4cf7632f),
SECP256K1_SCALAR_CONST(0x2c9c52b3, 0x3fa3cf1f, 0x5ad9e3fd, 0x77ed9ba5, 0xb294b893, 0x3722e9a5, 0x00e698ca, 0x4cf76330),
SECP256K1_SCALAR_CONST(0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xd576e735, 0x57a4501d, 0xdfe92f46, 0x681b209f),
SECP256K1_SCALAR_CONST(0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xd576e735, 0x57a4501d, 0xdfe92f46, 0x681b20a0),
SECP256K1_SCALAR_CONST(0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xd576e735, 0x57a4501d, 0xdfe92f46, 0x681b20a1),
SECP256K1_SCALAR_CONST(0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xd576e735, 0x57a4501d, 0xdfe92f46, 0x681b20a2),
SECP256K1_SCALAR_CONST(0xd363ad4c, 0xc05c30e0, 0xa5261c02, 0x88126459, 0xf85915d7, 0x7825b696, 0xbeebc5c2, 0x833ede11),
SECP256K1_SCALAR_CONST(0xd363ad4c, 0xc05c30e0, 0xa5261c02, 0x88126459, 0xf85915d7, 0x7825b696, 0xbeebc5c2, 0x833ede12),
SECP256K1_SCALAR_CONST(0xd363ad4c, 0xc05c30e0, 0xa5261c02, 0x88126459, 0xf85915d7, 0x7825b696, 0xbeebc5c2, 0x833ede13),
SECP256K1_SCALAR_CONST(0xd363ad4c, 0xc05c30e0, 0xa5261c02, 0x88126459, 0xf85915d7, 0x7825b696, 0xbeebc5c2, 0x833ede14),
SECP256K1_SCALAR_CONST(0x26c75a99, 0x80b861c1, 0x4a4c3805, 0x1024c8b4, 0x704d760e, 0xe95e7cd3, 0xde1bfdb1, 0xce2c5a42),
SECP256K1_SCALAR_CONST(0x26c75a99, 0x80b861c1, 0x4a4c3805, 0x1024c8b4, 0x704d760e, 0xe95e7cd3, 0xde1bfdb1, 0xce2c5a43),
SECP256K1_SCALAR_CONST(0x26c75a99, 0x80b861c1, 0x4a4c3805, 0x1024c8b4, 0x704d760e, 0xe95e7cd3, 0xde1bfdb1, 0xce2c5a44),
}

Definition at line 2840 of file tests.c.