Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "secp256k1.c"
#include "include/secp256k1.h"
#include "testrand_impl.h"
#include "contrib/lax_der_parsing.c"
#include "contrib/lax_der_privatekey_parsing.c"
Go to the source code of this file.
Classes | |
struct | ecmult_multi_data |
Macros | |
#define | VG_UNDEF(x, y) |
#define | VG_CHECK(x, y) |
#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 | run_context_tests (void) |
void | run_scratch_tests (void) |
void | run_sha256_tests (void) |
void | run_hmac_sha256_tests (void) |
void | run_rfc6979_hmac_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) |
void | random_num_negate (secp256k1_num *num) |
void | random_num_order_test (secp256k1_num *num) |
void | random_num_order (secp256k1_num *num) |
void | test_num_negate (void) |
void | test_num_add_sub (void) |
void | test_num_mod (void) |
void | test_num_jacobi (void) |
void | run_num_smalltests (void) |
void | scalar_test (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) |
int | check_fe_inverse (const secp256k1_fe *a, const secp256k1_fe *ai) |
void | run_field_convert (void) |
int | fe_memcmp (const secp256k1_fe *a, const secp256k1_fe *b) |
void | run_field_misc (void) |
void | run_field_inv (void) |
void | run_field_inv_var (void) |
void | run_field_inv_all_var (void) |
void | run_sqr (void) |
void | test_sqrt (const secp256k1_fe *a, const secp256k1_fe *k) |
void | run_sqrt (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_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 | 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_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 | 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 | 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_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) |
int | main (int argc, char **argv) |
Variables | |
static int | count = 64 |
static secp256k1_context * | ctx = NULL |
Macro Definition Documentation
◆ SECP256K1_EC_PARSE_TEST_NINVALID
#define SECP256K1_EC_PARSE_TEST_NINVALID (7) |
Referenced by run_ec_pubkey_parse_test().
◆ SECP256K1_EC_PARSE_TEST_NVALID
#define SECP256K1_EC_PARSE_TEST_NVALID (12) |
Referenced by run_ec_pubkey_parse_test().
◆ SECP256K1_EC_PARSE_TEST_NXVALID
#define SECP256K1_EC_PARSE_TEST_NXVALID (4) |
Referenced by run_ec_pubkey_parse_test().
◆ VG_CHECK
#define VG_CHECK | ( | x, | |
y | |||
) |
Definition at line 41 of file tests.c.
Referenced by ec_pubkey_parse_pointtest(), run_context_tests(), run_ec_pubkey_parse_test(), run_eckey_edge_case_test(), and test_ecdsa_edge_cases().
◆ VG_UNDEF
#define VG_UNDEF | ( | x, | |
y | |||
) |
Definition at line 40 of file tests.c.
Referenced by ec_pubkey_parse_pointtest(), run_context_tests(), run_ec_pubkey_parse_test(), run_eckey_edge_case_test(), and test_ecdsa_edge_cases().
Function Documentation
◆ assign_big_endian()
|
static |
Definition at line 4365 of file tests.c.
Referenced by random_ber_signature().
◆ check_fe_equal()
int check_fe_equal | ( | const secp256k1_fe * | a, |
const secp256k1_fe * | b | ||
) |
Definition at line 1639 of file tests.c.
References secp256k1_fe_equal_var(), secp256k1_fe_normalize_var(), and secp256k1_fe_normalize_weak().
Referenced by check_fe_inverse(), run_field_inv(), run_field_inv_all_var(), run_field_inv_var(), and run_field_misc().
◆ check_fe_inverse()
int check_fe_inverse | ( | const secp256k1_fe * | a, |
const secp256k1_fe * | ai | ||
) |
Definition at line 1647 of file tests.c.
References check_fe_equal(), SECP256K1_FE_CONST, and secp256k1_fe_mul().
Referenced by run_field_inv(), run_field_inv_all_var(), and run_field_inv_var().
◆ counting_illegal_callback_fn()
|
static |
Definition at line 48 of file tests.c.
Referenced by ec_pubkey_parse_pointtest(), run_context_tests(), run_ec_pubkey_parse_test(), run_eckey_edge_case_test(), run_scratch_tests(), test_ecdh_api(), test_ecdsa_edge_cases(), and test_ecdsa_recovery_api().
◆ damage_array()
|
static |
Definition at line 4377 of file tests.c.
References memmove(), secp256k1_rand_bits(), and secp256k1_rand_int().
Referenced by run_ecdsa_der_parse().
◆ ec_pubkey_parse_pointtest()
void ec_pubkey_parse_pointtest | ( | const unsigned char * | input, |
int | xvalid, | ||
int | yvalid | ||
) |
Definition at line 3318 of file tests.c.
References CHECK, counting_illegal_callback_fn(), ctx, memcpy(), secp256k1_context_set_illegal_callback(), SECP256K1_EC_COMPRESSED, secp256k1_ec_pubkey_parse(), secp256k1_ec_pubkey_serialize(), SECP256K1_EC_UNCOMPRESSED, secp256k1_pubkey_load(), secp256k1_pubkey_save(), VG_CHECK, and VG_UNDEF.
Referenced by run_ec_pubkey_parse_test().
◆ ecmult_const_chain_multiply()
void ecmult_const_chain_multiply | ( | void | ) |
Definition at line 2514 of file tests.c.
References ge_equals_gej(), secp256k1_ecmult_const(), secp256k1_ge_const_g, secp256k1_ge_set_gej(), SECP256K1_GEJ_CONST, secp256k1_gej_set_ge(), and SECP256K1_SCALAR_CONST.
Referenced by run_ecmult_const_tests().
◆ ecmult_const_commutativity()
void ecmult_const_commutativity | ( | void | ) |
Definition at line 2471 of file tests.c.
References ge_equals_ge(), random_scalar_order_test(), secp256k1_ecmult_const(), secp256k1_ge_const_g, and secp256k1_ge_set_gej().
Referenced by run_ecmult_const_tests().
◆ ecmult_const_mult_zero_one()
void ecmult_const_mult_zero_one | ( | void | ) |
Definition at line 2492 of file tests.c.
References CHECK, ge_equals_ge(), random_group_element_test(), secp256k1_ecmult_const(), secp256k1_ge_is_infinity(), secp256k1_ge_set_gej(), secp256k1_gej_neg(), SECP256K1_SCALAR_CONST, and secp256k1_scalar_negate().
Referenced by run_ecmult_const_tests().
◆ ecmult_const_random_mult()
void ecmult_const_random_mult | ( | void | ) |
Definition at line 2444 of file tests.c.
References CHECK, ge_equals_gej(), secp256k1_ecmult_const(), SECP256K1_GE_CONST, secp256k1_ge_is_valid_var(), and SECP256K1_SCALAR_CONST.
Referenced by run_ecmult_const_tests().
◆ ecmult_multi_callback()
|
static |
Definition at line 2552 of file tests.c.
References ecmult_multi_data::pt, and ecmult_multi_data::sc.
Referenced by test_ecmult_multi(), and test_ecmult_multi_batching().
◆ ecmult_multi_false_callback()
|
static |
Definition at line 2559 of file tests.c.
Referenced by test_ecmult_multi().
◆ fe_memcmp()
int fe_memcmp | ( | const secp256k1_fe * | a, |
const secp256k1_fe * | b | ||
) |
Definition at line 1684 of file tests.c.
Referenced by run_field_misc().
◆ ge_equals_ge()
void ge_equals_ge | ( | const secp256k1_ge * | a, |
const secp256k1_ge * | b | ||
) |
Definition at line 1877 of file tests.c.
References CHECK, secp256k1_ge::infinity, secp256k1_fe_equal_var(), secp256k1_ge::x, and secp256k1_ge::y.
Referenced by ecmult_const_commutativity(), ecmult_const_mult_zero_one(), run_ec_pubkey_parse_test(), test_point_times_order(), and test_random_pubkeys().
◆ ge_equals_gej()
void ge_equals_gej | ( | const secp256k1_ge * | a, |
const secp256k1_gej * | b | ||
) |
Definition at line 1908 of file tests.c.
References CHECK, secp256k1_ge::infinity, secp256k1_gej::infinity, secp256k1_fe_equal_var(), secp256k1_fe_mul(), secp256k1_fe_normalize_weak(), secp256k1_fe_sqr(), secp256k1_ge::x, secp256k1_gej::x, secp256k1_ge::y, secp256k1_gej::y, and secp256k1_gej::z.
Referenced by ecmult_const_chain_multiply(), ecmult_const_random_mult(), test_add_neg_y_diff_x(), test_ecmult_constants(), test_ecmult_gen_blind(), test_ge(), and test_point_times_order().
◆ gej_xyz_equals_gej()
int gej_xyz_equals_gej | ( | const secp256k1_gej * | a, |
const secp256k1_gej * | b | ||
) |
Definition at line 1887 of file tests.c.
References secp256k1_gej::infinity, secp256k1_fe_cmp_var(), secp256k1_fe_normalize(), secp256k1_gej::x, secp256k1_gej::y, and secp256k1_gej::z.
Referenced by test_ecmult_gen_blind(), and test_ecmult_gen_blind_reset().
◆ is_empty_signature()
int is_empty_signature | ( | const secp256k1_ecdsa_signature * | sig | ) |
Definition at line 4041 of file tests.c.
Referenced by test_ecdsa_edge_cases().
◆ main()
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 5019 of file tests.c.
References CHECK, count, ctx, fsbridge::fopen(), tinyformat::printf(), run_context_tests(), run_ec_combine(), run_ec_pubkey_parse_test(), run_ecdh_tests(), run_ecdsa_der_parse(), run_ecdsa_edge_cases(), run_ecdsa_end_to_end(), run_ecdsa_sign_verify(), run_eckey_edge_case_test(), run_ecmult_chain(), run_ecmult_const_tests(), run_ecmult_constants(), run_ecmult_gen_blind(), run_ecmult_multi_tests(), run_field_convert(), run_field_inv(), run_field_inv_all_var(), run_field_inv_var(), run_field_misc(), run_ge(), run_group_decompress(), run_hmac_sha256_tests(), run_num_smalltests(), run_point_times_order(), run_rand_bits(), run_rand_int(), run_random_pubkeys(), run_recovery_tests(), run_rfc6979_hmac_sha256_tests(), run_scalar_tests(), run_scratch_tests(), run_sha256_tests(), run_sqr(), run_sqrt(), run_wnaf(), secp256k1_context_create(), secp256k1_context_destroy(), secp256k1_context_randomize(), SECP256K1_CONTEXT_SIGN, SECP256K1_CONTEXT_VERIFY, secp256k1_rand256(), secp256k1_rand_bits(), and secp256k1_rand_seed().
◆ nonce_function_test_fail()
|
static |
Definition at line 4003 of file tests.c.
References nonce_function_rfc6979().
Referenced by test_ecdsa_edge_cases().
◆ nonce_function_test_retry()
|
static |
Definition at line 4011 of file tests.c.
References memcpy(), and nonce_function_rfc6979().
Referenced by test_ecdsa_edge_cases().
◆ precomputed_nonce_function()
|
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 3995 of file tests.c.
References memcpy().
Referenced by test_ecdsa_edge_cases().
◆ random_ber_signature()
|
static |
Definition at line 4404 of file tests.c.
References assign_big_endian(), CHECK, secp256k1_rand_bits(), secp256k1_rand_bytes_test(), and secp256k1_rand_int().
Referenced by run_ecdsa_der_parse().
◆ random_fe()
void random_fe | ( | secp256k1_fe * | x | ) |
Definition at line 1598 of file tests.c.
References secp256k1_fe_set_b32(), and secp256k1_rand256().
Referenced by random_fe_non_zero(), run_field_misc(), and run_sqrt().
◆ random_fe_non_square()
void random_fe_non_square | ( | secp256k1_fe * | ns | ) |
Definition at line 1631 of file tests.c.
References random_fe_non_zero(), secp256k1_fe_negate(), and secp256k1_fe_sqrt().
Referenced by run_sqrt().
◆ random_fe_non_zero()
void random_fe_non_zero | ( | secp256k1_fe * | nz | ) |
Definition at line 1618 of file tests.c.
References CHECK, random_fe(), secp256k1_fe_is_zero(), and secp256k1_fe_normalize().
Referenced by random_fe_non_square(), run_field_inv(), run_field_inv_all_var(), run_field_inv_var(), run_field_misc(), and test_ge().
◆ random_fe_test()
void random_fe_test | ( | secp256k1_fe * | x | ) |
Definition at line 1608 of file tests.c.
References secp256k1_fe_set_b32(), and secp256k1_rand256_test().
Referenced by run_group_decompress(), and test_group_decompress().
◆ random_field_element_magnitude()
void random_field_element_magnitude | ( | secp256k1_fe * | fe | ) |
Definition at line 74 of file tests.c.
References secp256k1_fe_add(), secp256k1_fe_clear(), secp256k1_fe_mul_int(), secp256k1_fe_negate(), secp256k1_fe_normalize(), secp256k1_rand_int(), and VERIFY_CHECK.
Referenced by test_ge().
◆ random_field_element_test()
void random_field_element_test | ( | secp256k1_fe * | fe | ) |
Definition at line 64 of file tests.c.
References secp256k1_fe_set_b32(), and secp256k1_rand256_test().
Referenced by random_group_element_jacobian_test(), random_group_element_test(), and test_ge().
◆ random_group_element_jacobian_test()
void random_group_element_jacobian_test | ( | secp256k1_gej * | gej, |
const secp256k1_ge * | ge | ||
) |
Definition at line 99 of file tests.c.
References secp256k1_ge::infinity, secp256k1_gej::infinity, random_field_element_test(), secp256k1_fe_is_zero(), secp256k1_fe_mul(), secp256k1_fe_sqr(), secp256k1_ge::x, secp256k1_gej::x, secp256k1_ge::y, secp256k1_gej::y, and secp256k1_gej::z.
Referenced by test_ge().
◆ random_group_element_test()
void random_group_element_test | ( | secp256k1_ge * | ge | ) |
Definition at line 88 of file tests.c.
References random_field_element_test(), secp256k1_fe_normalize(), secp256k1_ge_set_xo_var(), secp256k1_rand_bits(), and secp256k1_ge::y.
Referenced by ecmult_const_mult_zero_one(), test_ecmult_multi(), test_ecmult_multi_batching(), and test_ge().
◆ random_num_negate()
void random_num_negate | ( | secp256k1_num * | num | ) |
Definition at line 494 of file tests.c.
References secp256k1_num_negate(), and secp256k1_rand_bits().
Referenced by test_num_add_sub(), and test_num_negate().
◆ random_num_order()
void random_num_order | ( | secp256k1_num * | num | ) |
Definition at line 506 of file tests.c.
References random_scalar_order(), and secp256k1_scalar_get_num().
◆ random_num_order_test()
void random_num_order_test | ( | secp256k1_num * | num | ) |
Definition at line 500 of file tests.c.
References random_scalar_order_test(), and secp256k1_scalar_get_num().
Referenced by test_num_add_sub(), and test_num_negate().
◆ random_scalar_order()
void random_scalar_order | ( | secp256k1_scalar * | num | ) |
Definition at line 127 of file tests.c.
References secp256k1_rand256(), secp256k1_scalar_is_zero(), and secp256k1_scalar_set_b32().
Referenced by random_num_order(), run_wnaf(), test_bad_scalar(), test_ecdh_generator_basepoint(), test_ecmult_multi(), and test_ecmult_multi_batching().
◆ random_scalar_order_test()
void random_scalar_order_test | ( | secp256k1_scalar * | num | ) |
Definition at line 114 of file tests.c.
References secp256k1_rand256_test(), secp256k1_scalar_is_zero(), and secp256k1_scalar_set_b32().
Referenced by ecmult_const_commutativity(), random_num_order_test(), random_sign(), run_context_tests(), scalar_test(), test_ec_combine(), test_ecdsa_end_to_end(), test_ecdsa_recovery_end_to_end(), test_ecdsa_sign_verify(), test_ecmult_gen_blind(), test_num_jacobi(), test_num_mod(), and test_point_times_order().
◆ random_sign()
void random_sign | ( | secp256k1_scalar * | sigr, |
secp256k1_scalar * | sigs, | ||
const secp256k1_scalar * | key, | ||
const secp256k1_scalar * | msg, | ||
int * | recid | ||
) |
Definition at line 3957 of file tests.c.
References ctx, secp256k1_context_struct::ecmult_gen_ctx, random_scalar_order_test(), and secp256k1_ecdsa_sig_sign().
Referenced by test_ecdsa_sign_verify().
◆ run_context_tests()
void run_context_tests | ( | void | ) |
Definition at line 140 of file tests.c.
References CHECK, counting_illegal_callback_fn(), secp256k1_context_struct::ecmult_ctx, secp256k1_context_struct::ecmult_gen_ctx, secp256k1_context_struct::error_callback, secp256k1_callback::fn, random_scalar_order_test(), secp256k1_context_clone(), secp256k1_context_create(), secp256k1_context_destroy(), SECP256K1_CONTEXT_NONE, secp256k1_context_randomize(), secp256k1_context_set_error_callback(), secp256k1_context_set_illegal_callback(), SECP256K1_CONTEXT_SIGN, SECP256K1_CONTEXT_VERIFY, secp256k1_ec_pubkey_create(), secp256k1_ec_pubkey_negate(), secp256k1_ec_pubkey_tweak_add(), secp256k1_ec_pubkey_tweak_mul(), secp256k1_ecdsa_sig_sign(), secp256k1_ecdsa_sig_verify(), secp256k1_ecdsa_sign(), secp256k1_ecdsa_verify(), secp256k1_ecmult_context_build(), secp256k1_ecmult_gen(), secp256k1_ecmult_gen_context_build(), secp256k1_ge_set_gej(), VG_CHECK, and VG_UNDEF.
Referenced by main().
◆ run_ec_combine()
void run_ec_combine | ( | void | ) |
Definition at line 2241 of file tests.c.
References count, and test_ec_combine().
Referenced by main().
◆ run_ec_pubkey_parse_test()
void run_ec_pubkey_parse_test | ( | void | ) |
Definition at line 3393 of file tests.c.
References CHECK, counting_illegal_callback_fn(), ctx, ec_pubkey_parse_pointtest(), ge_equals_ge(), secp256k1_ge::infinity, secp256k1_context_no_precomp, secp256k1_context_set_illegal_callback(), SECP256K1_EC_PARSE_TEST_NINVALID, SECP256K1_EC_PARSE_TEST_NVALID, SECP256K1_EC_PARSE_TEST_NXVALID, secp256k1_ec_pubkey_parse(), secp256k1_ec_pubkey_serialize(), SECP256K1_EC_UNCOMPRESSED, secp256k1_ge_const_g, secp256k1_pubkey_load(), uncounting_illegal_callback_fn(), VG_CHECK, VG_UNDEF, secp256k1_ge::x, and secp256k1_ge::y.
Referenced by main().
◆ run_ecdsa_der_parse()
void run_ecdsa_der_parse | ( | void | ) |
Definition at line 4550 of file tests.c.
References CHECK, count, damage_array(), random_ber_signature(), and test_ecdsa_der_parse().
Referenced by main().
◆ run_ecdsa_edge_cases()
void run_ecdsa_edge_cases | ( | void | ) |
◆ run_ecdsa_end_to_end()
void run_ecdsa_end_to_end | ( | void | ) |
Definition at line 4244 of file tests.c.
References count, and test_ecdsa_end_to_end().
Referenced by main().
◆ run_ecdsa_sign_verify()
void run_ecdsa_sign_verify | ( | void | ) |
Definition at line 3987 of file tests.c.
References count, and test_ecdsa_sign_verify().
Referenced by main().
◆ run_eckey_edge_case_test()
void run_eckey_edge_case_test | ( | void | ) |
Definition at line 3721 of file tests.c.
References CHECK, counting_illegal_callback_fn(), ctx, memcpy(), secp256k1_context_set_illegal_callback(), SECP256K1_EC_COMPRESSED, secp256k1_ec_privkey_tweak_add(), secp256k1_ec_privkey_tweak_mul(), secp256k1_ec_pubkey_combine(), secp256k1_ec_pubkey_create(), secp256k1_ec_pubkey_serialize(), secp256k1_ec_pubkey_tweak_add(), secp256k1_ec_pubkey_tweak_mul(), secp256k1_ec_seckey_verify(), VG_CHECK, and VG_UNDEF.
Referenced by main().
◆ run_ecmult_chain()
void run_ecmult_chain | ( | void | ) |
Definition at line 2323 of file tests.c.
References CHECK, count, ctx, secp256k1_context_struct::ecmult_ctx, secp256k1_ecmult(), secp256k1_gej_add_var(), SECP256K1_GEJ_CONST, secp256k1_gej_is_infinity(), secp256k1_gej_neg(), secp256k1_scalar_add(), SECP256K1_SCALAR_CONST, and secp256k1_scalar_mul().
Referenced by main().
◆ run_ecmult_const_tests()
void run_ecmult_const_tests | ( | void | ) |
Definition at line 2540 of file tests.c.
References ecmult_const_chain_multiply(), ecmult_const_commutativity(), ecmult_const_mult_zero_one(), and ecmult_const_random_mult().
Referenced by main().
◆ run_ecmult_constants()
void run_ecmult_constants | ( | void | ) |
◆ run_ecmult_gen_blind()
void run_ecmult_gen_blind | ( | void | ) |
Definition at line 3280 of file tests.c.
References test_ecmult_gen_blind(), and test_ecmult_gen_blind_reset().
Referenced by main().
◆ run_ecmult_multi_tests()
void run_ecmult_multi_tests | ( | void | ) |
Definition at line 2966 of file tests.c.
References ALIGNMENT, ctx, secp256k1_context_struct::error_callback, secp256k1_ecmult_multi_var(), secp256k1_ecmult_pippenger_batch_single(), secp256k1_ecmult_strauss_batch_single(), secp256k1_scratch_create(), secp256k1_scratch_destroy(), secp256k1_strauss_scratch_size(), STRAUSS_SCRATCH_OBJECTS, test_ecmult_multi(), test_ecmult_multi_batch_size_helper(), test_ecmult_multi_batching(), test_ecmult_multi_pippenger_max_points(), and test_secp256k1_pippenger_bucket_window_inv().
Referenced by main().
◆ run_field_convert()
void run_field_convert | ( | void | ) |
Definition at line 1654 of file tests.c.
References CHECK, SECP256K1_FE_CONST, secp256k1_fe_equal_var(), secp256k1_fe_from_storage(), secp256k1_fe_get_b32(), secp256k1_fe_set_b32(), SECP256K1_FE_STORAGE_CONST, and secp256k1_fe_to_storage().
Referenced by main().
◆ run_field_inv()
void run_field_inv | ( | void | ) |
Definition at line 1765 of file tests.c.
References CHECK, check_fe_equal(), check_fe_inverse(), count, random_fe_non_zero(), and secp256k1_fe_inv().
Referenced by main().
◆ run_field_inv_all_var()
void run_field_inv_all_var | ( | void | ) |
Definition at line 1789 of file tests.c.
References CHECK, check_fe_equal(), check_fe_inverse(), count, random_fe_non_zero(), secp256k1_fe_inv_all_var(), and secp256k1_rand_int().
Referenced by main().
◆ run_field_inv_var()
void run_field_inv_var | ( | void | ) |
Definition at line 1777 of file tests.c.
References CHECK, check_fe_equal(), check_fe_inverse(), count, random_fe_non_zero(), and secp256k1_fe_inv_var().
Referenced by main().
◆ run_field_misc()
void run_field_misc | ( | void | ) |
Definition at line 1693 of file tests.c.
References CHECK, check_fe_equal(), count, fe_memcmp(), random_fe(), random_fe_non_zero(), secp256k1_fe_add(), secp256k1_fe_cmov(), secp256k1_fe_cmp_var(), SECP256K1_FE_CONST, secp256k1_fe_equal_var(), secp256k1_fe_from_storage(), secp256k1_fe_mul(), secp256k1_fe_mul_int(), secp256k1_fe_negate(), secp256k1_fe_normalize_var(), secp256k1_fe_storage_cmov(), secp256k1_fe_to_storage(), and VERIFY_CHECK.
Referenced by main().
◆ run_ge()
void run_ge | ( | void | ) |
◆ run_group_decompress()
void run_group_decompress | ( | void | ) |
Definition at line 2312 of file tests.c.
References count, random_fe_test(), and test_group_decompress().
Referenced by main().
◆ run_hmac_sha256_tests()
void run_hmac_sha256_tests | ( | void | ) |
Definition at line 334 of file tests.c.
References CHECK, secp256k1_hmac_sha256_finalize(), secp256k1_hmac_sha256_initialize(), secp256k1_hmac_sha256_write(), and secp256k1_rand_int().
Referenced by main().
◆ run_num_smalltests()
void run_num_smalltests | ( | void | ) |
Definition at line 666 of file tests.c.
References count, test_num_add_sub(), test_num_jacobi(), test_num_mod(), and test_num_negate().
Referenced by main().
◆ run_point_times_order()
void run_point_times_order | ( | void | ) |
Definition at line 2422 of file tests.c.
References CHECK, SECP256K1_FE_CONST, secp256k1_fe_equal_var(), secp256k1_fe_normalize_var(), secp256k1_fe_sqr(), secp256k1_ge_is_valid_var(), secp256k1_ge_set_xo_var(), secp256k1_gej_is_valid_var(), secp256k1_gej_set_ge(), and test_point_times_order().
Referenced by main().
◆ run_rand_bits()
void run_rand_bits | ( | void | ) |
◆ run_rand_int()
void run_rand_int | ( | void | ) |
◆ run_random_pubkeys()
void run_random_pubkeys | ( | void | ) |
Definition at line 4237 of file tests.c.
References count, and test_random_pubkeys().
Referenced by main().
◆ run_rfc6979_hmac_sha256_tests()
void run_rfc6979_hmac_sha256_tests | ( | void | ) |
Definition at line 378 of file tests.c.
References CHECK, secp256k1_rfc6979_hmac_sha256_finalize(), secp256k1_rfc6979_hmac_sha256_generate(), and secp256k1_rfc6979_hmac_sha256_initialize().
Referenced by main().
◆ run_scalar_tests()
void run_scalar_tests | ( | void | ) |
Definition at line 968 of file tests.c.
References CHECK, count, scalar_test(), secp256k1_num_get_bin(), secp256k1_scalar_add(), secp256k1_scalar_check_overflow(), SECP256K1_SCALAR_CONST, secp256k1_scalar_eq(), secp256k1_scalar_inverse(), secp256k1_scalar_inverse_var(), secp256k1_scalar_is_one(), secp256k1_scalar_is_zero(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), secp256k1_scalar_order_get_num(), secp256k1_scalar_set_b32(), secp256k1_scalar_set_int(), and secp256k1_scalar_sqr().
Referenced by main().
◆ run_scratch_tests()
void run_scratch_tests | ( | void | ) |
Definition at line 258 of file tests.c.
References CHECK, counting_illegal_callback_fn(), secp256k1_context_create(), secp256k1_context_destroy(), SECP256K1_CONTEXT_NONE, secp256k1_context_set_illegal_callback(), secp256k1_scratch_alloc(), secp256k1_scratch_allocate_frame(), secp256k1_scratch_deallocate_frame(), secp256k1_scratch_max_allocation(), secp256k1_scratch_space_create(), and secp256k1_scratch_space_destroy().
Referenced by main().
◆ run_sha256_tests()
void run_sha256_tests | ( | void | ) |
Definition at line 298 of file tests.c.
References CHECK, secp256k1_rand_int(), secp256k1_sha256_finalize(), secp256k1_sha256_initialize(), and secp256k1_sha256_write().
Referenced by main().
◆ run_sqr()
void run_sqr | ( | void | ) |
Definition at line 1811 of file tests.c.
References secp256k1_fe_mul_int(), secp256k1_fe_negate(), secp256k1_fe_normalize(), secp256k1_fe_set_int(), and secp256k1_fe_sqr().
Referenced by main().
◆ run_sqrt()
void run_sqrt | ( | void | ) |
Definition at line 1841 of file tests.c.
References count, random_fe(), random_fe_non_square(), secp256k1_fe_mul(), secp256k1_fe_negate(), secp256k1_fe_set_int(), secp256k1_fe_sqr(), and test_sqrt().
Referenced by main().
◆ run_wnaf()
void run_wnaf | ( | void | ) |
Definition at line 3181 of file tests.c.
References CHECK, count, secp256k1_scalar::d, random_scalar_order(), secp256k1_scalar_cond_negate(), secp256k1_scalar_is_zero(), secp256k1_scalar_set_int(), test_constant_wnaf(), test_constant_wnaf_negate(), test_fixed_wnaf(), test_fixed_wnaf_small(), and test_wnaf().
Referenced by main().
◆ scalar_test()
void scalar_test | ( | void | ) |
Definition at line 679 of file tests.c.
References CHECK, secp256k1_scalar::d, low, random_scalar_order_test(), secp256k1_num_add(), secp256k1_num_cmp(), secp256k1_num_eq(), secp256k1_num_is_one(), secp256k1_num_is_zero(), secp256k1_num_mod(), secp256k1_num_mod_inverse(), secp256k1_num_mul(), secp256k1_num_set_bin(), secp256k1_num_shift(), secp256k1_num_sub(), secp256k1_rand_bits(), secp256k1_rand_int(), secp256k1_scalar_add(), secp256k1_scalar_cadd_bit(), secp256k1_scalar_eq(), secp256k1_scalar_get_b32(), secp256k1_scalar_get_bits(), secp256k1_scalar_get_bits_var(), secp256k1_scalar_get_num(), secp256k1_scalar_inverse(), secp256k1_scalar_is_high(), secp256k1_scalar_is_one(), secp256k1_scalar_is_zero(), secp256k1_scalar_mul(), secp256k1_scalar_mul_shift_var(), secp256k1_scalar_negate(), secp256k1_scalar_order_get_num(), secp256k1_scalar_set_int(), secp256k1_scalar_shr_int(), and secp256k1_scalar_sqr().
Referenced by run_scalar_tests().
◆ test_add_neg_y_diff_x()
void test_add_neg_y_diff_x | ( | void | ) |
Definition at line 2141 of file tests.c.
References ge_equals_gej(), secp256k1_ge_set_gej(), secp256k1_gej_add_ge(), secp256k1_gej_add_ge_var(), secp256k1_gej_add_var(), and SECP256K1_GEJ_CONST.
Referenced by run_ge().
◆ test_constant_wnaf()
void test_constant_wnaf | ( | const secp256k1_scalar * | number, |
int | w | ||
) |
Definition at line 3036 of file tests.c.
References immer::detail::rbts::bits, CHECK, secp256k1_scalar_add(), secp256k1_scalar_cadd_bit(), secp256k1_scalar_eq(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), secp256k1_scalar_set_int(), secp256k1_scalar_shr_int(), secp256k1_wnaf_const(), and WNAF_SIZE_BITS.
Referenced by run_wnaf().
◆ test_constant_wnaf_negate()
void test_constant_wnaf_negate | ( | const secp256k1_scalar * | number | ) |
Definition at line 3021 of file tests.c.
References CHECK, secp256k1_scalar_cond_negate(), secp256k1_scalar_eq(), secp256k1_scalar_get_bits(), secp256k1_scalar_is_even(), and secp256k1_scalar_negate().
Referenced by run_wnaf().
◆ test_ec_combine()
void test_ec_combine | ( | void | ) |
Definition at line 2216 of file tests.c.
References CHECK, ctx, secp256k1_context_struct::ecmult_gen_ctx, random_scalar_order_test(), secp256k1_ec_pubkey_combine(), secp256k1_ecmult_gen(), secp256k1_ge_set_gej(), secp256k1_pubkey_save(), secp256k1_scalar_add(), SECP256K1_SCALAR_CONST, and sum.
Referenced by run_ec_combine().
◆ 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 4251 of file tests.c.
References CHECK, ctx, ecdsa_signature_parse_der_lax(), secp256k1_ecdsa_signature_parse_der(), secp256k1_ecdsa_signature_serialize_compact(), and secp256k1_ecdsa_signature_serialize_der().
Referenced by run_ecdsa_der_parse().
◆ test_ecdsa_edge_cases()
void test_ecdsa_edge_cases | ( | void | ) |
Definition at line 4582 of file tests.c.
References CHECK, counting_illegal_callback_fn(), ctx, ec_privkey_export_der(), secp256k1_context_struct::ecmult_ctx, secp256k1_context_struct::ecmult_gen_ctx, is_empty_signature(), nonce_function_rfc6979(), nonce_function_test_fail(), nonce_function_test_retry(), precomputed_nonce_function(), secp256k1_context_set_illegal_callback(), secp256k1_ec_pubkey_create(), secp256k1_ecdsa_sig_verify(), secp256k1_ecdsa_sign(), secp256k1_ecdsa_signature_load(), secp256k1_ecdsa_signature_normalize(), secp256k1_ecdsa_signature_parse_compact(), secp256k1_ecdsa_signature_parse_der(), secp256k1_ecdsa_signature_serialize_compact(), secp256k1_ecdsa_signature_serialize_der(), secp256k1_ecdsa_verify(), secp256k1_eckey_pubkey_parse(), secp256k1_ecmult_gen(), secp256k1_ge_set_gej(), secp256k1_scalar_eq(), secp256k1_scalar_inverse(), secp256k1_scalar_inverse_var(), secp256k1_scalar_negate(), secp256k1_scalar_set_b32(), secp256k1_scalar_set_int(), VG_CHECK, and VG_UNDEF.
Referenced by run_ecdsa_edge_cases().
◆ test_ecdsa_end_to_end()
void test_ecdsa_end_to_end | ( | void | ) |
Definition at line 4046 of file tests.c.
References CHECK, ctx, ec_privkey_export_der(), ec_privkey_import_der(), memcpy(), random_scalar_order_test(), SECP256K1_EC_COMPRESSED, secp256k1_ec_privkey_tweak_add(), secp256k1_ec_privkey_tweak_mul(), secp256k1_ec_pubkey_create(), secp256k1_ec_pubkey_negate(), secp256k1_ec_pubkey_parse(), secp256k1_ec_pubkey_serialize(), secp256k1_ec_pubkey_tweak_add(), secp256k1_ec_pubkey_tweak_mul(), secp256k1_ec_seckey_verify(), SECP256K1_EC_UNCOMPRESSED, secp256k1_ecdsa_sign(), secp256k1_ecdsa_signature_load(), secp256k1_ecdsa_signature_normalize(), secp256k1_ecdsa_signature_parse_der(), secp256k1_ecdsa_signature_save(), secp256k1_ecdsa_signature_serialize_der(), secp256k1_ecdsa_verify(), secp256k1_rand256_test(), secp256k1_rand_bits(), secp256k1_rand_int(), secp256k1_scalar_get_b32(), and secp256k1_scalar_negate().
Referenced by run_ecdsa_end_to_end().
◆ test_ecdsa_sign_verify()
void test_ecdsa_sign_verify | ( | void | ) |
Definition at line 3964 of file tests.c.
References CHECK, ctx, secp256k1_context_struct::ecmult_ctx, secp256k1_context_struct::ecmult_gen_ctx, random_scalar_order_test(), random_sign(), secp256k1_ecdsa_sig_verify(), secp256k1_ecmult_gen(), secp256k1_ge_set_gej(), secp256k1_rand_bits(), secp256k1_scalar_add(), and secp256k1_scalar_set_int().
Referenced by run_ecdsa_sign_verify().
◆ test_ecmult_constants()
void test_ecmult_constants | ( | void | ) |
Definition at line 3208 of file tests.c.
References CHECK, ctx, secp256k1_context_struct::ecmult_gen_ctx, ge_equals_gej(), secp256k1_ecmult_gen(), secp256k1_ge_const_g, secp256k1_ge_neg(), secp256k1_gej_add_ge(), secp256k1_gej_is_infinity(), secp256k1_scalar_negate(), and secp256k1_scalar_set_int().
Referenced by run_ecmult_constants().
◆ test_ecmult_gen_blind()
void test_ecmult_gen_blind | ( | void | ) |
Definition at line 3245 of file tests.c.
References secp256k1_ecmult_gen_context::blind, CHECK, ctx, secp256k1_context_struct::ecmult_gen_ctx, ge_equals_gej(), gej_xyz_equals_gej(), secp256k1_ecmult_gen_context::initial, random_scalar_order_test(), secp256k1_ecmult_gen(), secp256k1_ecmult_gen_blind(), secp256k1_ge_set_gej(), secp256k1_rand256(), and secp256k1_scalar_eq().
Referenced by run_ecmult_gen_blind().
◆ test_ecmult_gen_blind_reset()
void test_ecmult_gen_blind_reset | ( | void | ) |
Definition at line 3268 of file tests.c.
References secp256k1_ecmult_gen_context::blind, CHECK, ctx, secp256k1_context_struct::ecmult_gen_ctx, gej_xyz_equals_gej(), secp256k1_ecmult_gen_context::initial, secp256k1_ecmult_gen_blind(), and secp256k1_scalar_eq().
Referenced by run_ecmult_gen_blind().
◆ test_ecmult_multi()
void test_ecmult_multi | ( | secp256k1_scratch * | scratch, |
secp256k1_ecmult_multi_func | ecmult_multi | ||
) |
Definition at line 2567 of file tests.c.
References CHECK, count, ctx, secp256k1_context_struct::ecmult_ctx, ecmult_multi_callback(), ecmult_multi_false_callback(), secp256k1_context_struct::error_callback, ecmult_multi_data::pt, random_group_element_test(), random_scalar_order(), ecmult_multi_data::sc, secp256k1_ecmult(), secp256k1_ge_const_g, secp256k1_ge_neg(), secp256k1_ge_set_gej(), secp256k1_ge_set_infinity(), secp256k1_gej_add_ge_var(), secp256k1_gej_add_var(), secp256k1_gej_is_infinity(), secp256k1_gej_neg(), secp256k1_gej_set_ge(), secp256k1_gej_set_infinity(), secp256k1_scalar_add(), secp256k1_scalar_clear(), secp256k1_scalar_cond_negate(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), secp256k1_scalar_set_int(), secp256k1_scratch_create(), and secp256k1_scratch_destroy().
Referenced by run_ecmult_multi_tests().
◆ test_ecmult_multi_batch_size_helper()
void test_ecmult_multi_batch_size_helper | ( | void | ) |
Definition at line 2857 of file tests.c.
References CHECK, ECMULT_MAX_POINTS_PER_BATCH, and secp256k1_ecmult_multi_batch_size_helper().
Referenced by run_ecmult_multi_tests().
◆ 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 2905 of file tests.c.
References ALIGNMENT, CHECK, checked_malloc(), ctx, secp256k1_context_struct::ecmult_ctx, ecmult_multi_callback(), ECMULT_PIPPENGER_THRESHOLD, secp256k1_context_struct::error_callback, PIPPENGER_SCRATCH_OBJECTS, ecmult_multi_data::pt, random_group_element_test(), random_scalar_order(), ecmult_multi_data::sc, secp256k1_ecmult(), secp256k1_ecmult_multi_var(), secp256k1_gej_add_var(), secp256k1_gej_is_infinity(), secp256k1_gej_neg(), secp256k1_gej_set_ge(), secp256k1_gej_set_infinity(), secp256k1_pippenger_bucket_window(), secp256k1_pippenger_scratch_size(), secp256k1_scalar_set_int(), secp256k1_scratch_create(), secp256k1_scratch_destroy(), secp256k1_strauss_scratch_size(), and STRAUSS_SCRATCH_OBJECTS.
Referenced by run_ecmult_multi_tests().
◆ 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 2834 of file tests.c.
References CHECK, ctx, secp256k1_context_struct::error_callback, PIPPENGER_MAX_BUCKET_WINDOW, PIPPENGER_SCRATCH_OBJECTS, secp256k1_pippenger_bucket_window(), secp256k1_pippenger_bucket_window_inv(), secp256k1_pippenger_max_points(), secp256k1_pippenger_scratch_size(), secp256k1_rand_int(), secp256k1_scratch_allocate_frame(), secp256k1_scratch_create(), secp256k1_scratch_deallocate_frame(), and secp256k1_scratch_destroy().
Referenced by run_ecmult_multi_tests().
◆ test_fixed_wnaf()
void test_fixed_wnaf | ( | const secp256k1_scalar * | number, |
int | w | ||
) |
Definition at line 3077 of file tests.c.
References CHECK, secp256k1_scalar_add(), secp256k1_scalar_cadd_bit(), secp256k1_scalar_eq(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), secp256k1_scalar_set_int(), secp256k1_scalar_shr_int(), secp256k1_wnaf_fixed(), and WNAF_SIZE.
Referenced by run_wnaf().
◆ test_fixed_wnaf_small()
void test_fixed_wnaf_small | ( | void | ) |
Definition at line 3127 of file tests.c.
References CHECK, secp256k1_scalar_set_int(), secp256k1_wnaf_fixed(), test_fixed_wnaf_small_helper(), and WNAF_SIZE.
Referenced by run_wnaf().
◆ test_fixed_wnaf_small_helper()
void test_fixed_wnaf_small_helper | ( | int * | wnaf, |
int * | wnaf_expected, | ||
int | w | ||
) |
Definition at line 3117 of file tests.c.
References CHECK, and WNAF_SIZE.
Referenced by test_fixed_wnaf_small().
◆ test_ge()
void test_ge | ( | void | ) |
Definition at line 1925 of file tests.c.
References CHECK, checked_malloc(), ctx, secp256k1_context_struct::error_callback, ge_equals_gej(), random_fe_non_zero(), random_field_element_magnitude(), random_field_element_test(), random_group_element_jacobian_test(), random_group_element_test(), secp256k1_fe_equal_var(), secp256k1_fe_inv_all_var(), secp256k1_fe_inv_var(), secp256k1_fe_is_odd(), secp256k1_fe_is_zero(), secp256k1_fe_mul(), secp256k1_fe_sqr(), secp256k1_ge_clear(), secp256k1_ge_is_infinity(), secp256k1_ge_neg(), secp256k1_ge_set_all_gej_var(), secp256k1_ge_set_gej_var(), secp256k1_ge_set_infinity(), secp256k1_gej_add_ge(), secp256k1_gej_add_ge_var(), secp256k1_gej_add_var(), secp256k1_gej_add_zinv_var(), SECP256K1_GEJ_CONST_INFINITY, secp256k1_gej_double_var(), secp256k1_gej_is_infinity(), secp256k1_gej_rescale(), secp256k1_gej_set_ge(), secp256k1_gej_set_infinity(), secp256k1_rand_int(), sum, secp256k1_ge::x, secp256k1_ge::y, and secp256k1_gej::z.
Referenced by run_ge().
◆ test_group_decompress()
void test_group_decompress | ( | const secp256k1_fe * | x | ) |
Definition at line 2248 of file tests.c.
References CHECK, secp256k1_ge::infinity, random_fe_test(), secp256k1_fe_equal_var(), secp256k1_fe_is_odd(), secp256k1_fe_is_quad_var(), secp256k1_fe_is_zero(), secp256k1_fe_normalize_var(), secp256k1_ge_set_xo_var(), secp256k1_ge_set_xquad(), secp256k1_gej_has_quad_y_var(), secp256k1_gej_neg(), secp256k1_gej_rescale(), secp256k1_gej_set_ge(), secp256k1_ge::x, and secp256k1_ge::y.
Referenced by run_group_decompress().
◆ test_num_add_sub()
void test_num_add_sub | ( | void | ) |
Definition at line 532 of file tests.c.
References CHECK, random_num_negate(), random_num_order_test(), secp256k1_num_add(), secp256k1_num_eq(), secp256k1_num_is_one(), secp256k1_num_negate(), secp256k1_num_sub(), secp256k1_rand_bits(), secp256k1_scalar_get_num(), and secp256k1_scalar_set_int().
Referenced by run_num_smalltests().
◆ test_num_jacobi()
void test_num_jacobi | ( | void | ) |
test large values with 5 as group order
test with secp group order as order
Definition at line 605 of file tests.c.
References CHECK, random_scalar_order_test(), secp256k1_num_add(), secp256k1_num_is_zero(), secp256k1_num_jacobi(), secp256k1_num_mod(), secp256k1_num_sub(), secp256k1_scalar_get_num(), secp256k1_scalar_mul(), secp256k1_scalar_order_get_num(), secp256k1_scalar_set_int(), and secp256k1_scalar_sqr().
Referenced by run_num_smalltests().
◆ test_num_mod()
void test_num_mod | ( | void | ) |
Definition at line 574 of file tests.c.
References CHECK, random_scalar_order_test(), secp256k1_num_add(), secp256k1_num_is_zero(), secp256k1_num_mod(), secp256k1_scalar_get_num(), and secp256k1_scalar_set_int().
Referenced by run_num_smalltests().
◆ test_num_negate()
void test_num_negate | ( | void | ) |
Definition at line 512 of file tests.c.
References CHECK, random_num_negate(), random_num_order_test(), secp256k1_num_add(), secp256k1_num_copy(), secp256k1_num_eq(), secp256k1_num_is_neg(), secp256k1_num_is_zero(), secp256k1_num_negate(), and secp256k1_num_sub().
Referenced by run_num_smalltests().
◆ test_point_times_order()
void test_point_times_order | ( | const secp256k1_gej * | point | ) |
Definition at line 2387 of file tests.c.
References CHECK, ctx, secp256k1_context_struct::ecmult_ctx, ge_equals_ge(), ge_equals_gej(), random_scalar_order_test(), secp256k1_eckey_pubkey_serialize(), secp256k1_ecmult(), secp256k1_ge_const_g, secp256k1_ge_is_infinity(), secp256k1_ge_is_valid_var(), secp256k1_ge_set_gej(), secp256k1_gej_add_var(), secp256k1_gej_is_infinity(), secp256k1_gej_is_valid_var(), SECP256K1_SCALAR_CONST, and secp256k1_scalar_negate().
Referenced by run_point_times_order().
◆ test_rand_bits()
void test_rand_bits | ( | int | rand32, |
int | bits | ||
) |
Definition at line 421 of file tests.c.
References immer::detail::rbts::bits, CHECK, secp256k1_rand32(), and secp256k1_rand_bits().
Referenced by run_rand_bits().
◆ test_rand_int()
void test_rand_int | ( | uint32_t | range, |
uint32_t | subrange | ||
) |
Definition at line 456 of file tests.c.
References CHECK, and secp256k1_rand_int().
Referenced by run_rand_int().
◆ test_random_pubkeys()
void test_random_pubkeys | ( | void | ) |
Definition at line 4177 of file tests.c.
References CHECK, ge_equals_ge(), secp256k1_eckey_pubkey_parse(), secp256k1_eckey_pubkey_serialize(), secp256k1_rand256(), and secp256k1_rand_bits().
Referenced by run_random_pubkeys().
◆ test_secp256k1_pippenger_bucket_window_inv()
void test_secp256k1_pippenger_bucket_window_inv | ( | void | ) |
Definition at line 2812 of file tests.c.
References CHECK, PIPPENGER_MAX_BUCKET_WINDOW, secp256k1_pippenger_bucket_window(), and secp256k1_pippenger_bucket_window_inv().
Referenced by run_ecmult_multi_tests().
◆ test_sqrt()
void test_sqrt | ( | const secp256k1_fe * | a, |
const secp256k1_fe * | k | ||
) |
Definition at line 1827 of file tests.c.
References CHECK, secp256k1_fe_add(), secp256k1_fe_is_zero(), secp256k1_fe_negate(), secp256k1_fe_normalize(), and secp256k1_fe_sqrt().
Referenced by run_sqrt().
◆ test_wnaf()
void test_wnaf | ( | const secp256k1_scalar * | number, |
int | w | ||
) |
Definition at line 2987 of file tests.c.
References immer::detail::rbts::bits, CHECK, secp256k1_ecmult_wnaf(), secp256k1_scalar_add(), secp256k1_scalar_eq(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), and secp256k1_scalar_set_int().
Referenced by run_wnaf().
◆ uncounting_illegal_callback_fn()
|
static |
Definition at line 56 of file tests.c.
Referenced by run_ec_pubkey_parse_test().
Variable Documentation
◆ count
|
static |
Definition at line 45 of file tests.c.
Referenced by __attribute__(), CBLSWorker::AggregatePublicKeys(), CBLSWorker::AggregateSecretKeys(), CBLSWorker::AggregateSigs(), Aggregator< T >::Aggregator(), Aggregator< T >::AsyncAggregateAndPushAggQueue(), AsyncAggregateHelper(), CBLSWorker::AsyncAggregatePublicKeys(), CBLSWorker::AsyncAggregateSecretKeys(), CBLSWorker::AsyncAggregateSigs(), CBLSWorker::AsyncBuildQuorumVerificationVector(), ContributionVerifier::AsyncVerifyBatchOneByOne(), CCoinsViewDB::BatchWrite(), bench_ecmult(), CBLSWorker::BuildQuorumVerificationVector(), BuildTestVectors(), CCrypter::BytesToKeySHA512AES(), immer::detail::rbts::node< T, MemoryPolicy, B, BL >::check(), llmq::CSigSharesManager::Cleanup(), BerkeleyEnvironment::Close(), llmq::CSigSharesManager::CollectSigSharesToSendConcentrated(), immer::detail::arrays::node< T, MemoryPolicy >::copy_e(), immer::detail::arrays::node< T, MemoryPolicy >::copy_n(), cxxtimer::Timer::count(), llmq::CSigSharesInv::CountSet(), llmq::CFinalCommitment::CountSigners(), llmq::CFinalCommitment::CountValidMembers(), llmq::CDKGPrematureCommitment::CountValidMembers(), immer::free_list_heap< Size, Limit, Base >::deallocate(), immer::detail::unsafe_free_list_heap_impl< detail::unsafe_free_list_storage, Size, Limit, Base >::deallocate(), EvalScript(), prevector< N, T, Size, Diff >::fill(), FindFilesToPrune(), FindFilesToPruneManual(), immer::detail::arrays::no_capacity< T, MemoryPolicy >::from_range(), immer::detail::arrays::with_capacity< T, MemoryPolicy >::from_range(), CBLSWorker::GenerateContributions(), AbstractThresholdConditionChecker::GetStateFor(), AbstractThresholdConditionChecker::GetStateStatisticsFor(), CDeterministicMNList::GetValidMNsCount(), groestl_big_close(), groestl_small_close(), ContributionVerifier::HandleVerifyDone(), CBLSIESMultiRecipientBlobs::InitEncrypt(), prevector< N, T, Size, Diff >::insert(), llmq::CFinalCommitment::IsNull(), benchmark::State::KeepRunning(), LoadMempool(), main(), immer::detail::rbts::make_leaf_sub_pos(), immer::detail::rbts::make_singleton_regular_sub_pos(), TrafficGraphWidget::paintEvent(), quorum_list(), quorum_memberof(), AddressTableModel::removeRows(), RecentRequestsTableModel::removeRows(), CGovernanceManager::RequestGovernanceObjectVotes(), RequestObject(), rest_headers(), RollingBloom(), run_benchmark(), run_ec_combine(), run_ecdsa_der_parse(), run_ecdsa_end_to_end(), run_ecdsa_sign_verify(), run_ecmult_chain(), run_field_inv(), run_field_inv_all_var(), run_field_inv_var(), run_field_misc(), run_ge(), run_group_decompress(), run_num_smalltests(), run_random_pubkeys(), run_recovery_tests(), run_scalar_tests(), run_sqrt(), run_test(), run_wnaf(), secp256k1_ecdsa_sign(), secp256k1_ecdsa_sign_recoverable(), secp256k1_scalar_get_bits(), secp256k1_scalar_get_bits_var(), PeerLogicValidation::SendMessages(), CTxUndo::Serialize(), SetHasKeys(), RPCConsole::setInstantSendLockCount(), ModalOverlay::setKnownBestHeight(), RPCConsole::setNumBlocks(), BitcoinGUI::setNumBlocks(), immer::detail::rbts::concat_rebalance_plan< B, BL >::shuffle(), CZMQAbstractPublishNotifier::Shutdown(), immer::detail::hamts::node< T, Hash, Equal, MemoryPolicy, B >::sizeof_collision_n(), immer::detail::hamts::node< T, Hash, Equal, MemoryPolicy, B >::sizeof_inner_n(), immer::detail::arrays::node< T, MemoryPolicy >::sizeof_n(), immer::detail::rbts::node< T, MemoryPolicy, B, BL >::sizeof_packed_inner_n(), immer::detail::rbts::node< T, MemoryPolicy, B, BL >::sizeof_packed_inner_r_n(), immer::detail::rbts::node< T, MemoryPolicy, B, BL >::sizeof_packed_leaf_n(), immer::detail::rbts::node< T, MemoryPolicy, B, BL >::sizeof_packed_relaxed_n(), immer::detail::hamts::node< T, Hash, Equal, MemoryPolicy, B >::sizeof_values_n(), Aggregator< T >::Start(), Aggregator< T >::SyncAggregate(), Aggregator< T >::SyncAggregateAndPushAggQueue(), test_ecmult_multi(), ModalOverlay::tipUpdate(), llmq::CDKGDebugSessionStatus::ToJson(), toPosixTime(), CTxUndo::Unserialize(), BitcoinGUI::updateNetworkState(), CCoinsViewDB::Upgrade(), CBLSWorker::VerifySecretKeyVector(), CBLSWorker::VerifySignatureVector(), VerifyVectorHelper(), CBLSWorker::VerifyVerificationVector(), CBLSWorker::VerifyVerificationVectors(), immer::detail::rbts::slice_left_visitor< NodeT, Collapse >::visit_inner(), immer::detail::rbts::slice_left_mut_visitor< NodeT, Collapse, Mutating >::visit_leaf(), immer::detail::rbts::concat_rebalance_plan_fill_visitor::visit_node(), immer::detail::rbts::update_visitor< NodeT >::visit_regular(), immer::detail::rbts::get_mut_visitor< NodeT >::visit_regular(), immer::detail::rbts::push_tail_visitor< NodeT >::visit_regular(), immer::detail::rbts::slice_left_mut_visitor< NodeT, Collapse, Mutating >::visit_regular(), immer::detail::rbts::update_visitor< NodeT >::visit_relaxed(), immer::detail::rbts::get_mut_visitor< NodeT >::visit_relaxed(), immer::detail::rbts::push_tail_mut_visitor< NodeT, Mutating >::visit_relaxed(), immer::detail::rbts::push_tail_visitor< NodeT >::visit_relaxed(), immer::detail::rbts::slice_right_visitor< NodeT, Collapse >::visit_relaxed(), and immer::detail::rbts::slice_left_mut_visitor< NodeT, Collapse, Mutating >::visit_relaxed().
◆ ctx
|
static |
Definition at line 46 of file tests.c.
Referenced by AddressTableModel::addRow(), AES128_decrypt(), AES128_encrypt(), AES128_init(), AES192_decrypt(), AES192_encrypt(), AES192_init(), AES256_decrypt(), AES256_encrypt(), AES256_init(), bench_AES128_decrypt(), bench_AES128_encrypt(), bench_AES128_encrypt_setup(), bench_AES128_init(), bench_AES192_decrypt(), bench_AES192_encrypt(), bench_AES192_encrypt_setup(), bench_AES192_init(), bench_AES256_decrypt(), bench_AES256_encrypt(), bench_AES256_encrypt_setup(), bench_AES256_init(), CHACHA20(), ec_privkey_export_der(), ec_privkey_import_der(), ec_pubkey_parse_pointtest(), ECC_Start(), ECC_Stop(), ecdsa_signature_parse_der_lax(), TorControlConnection::eventcb(), PaymentRequestPlus::getMerchant(), http_request_done(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add(), Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul(), Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context(), main(), SendCoinsDialog::on_sendButton_clicked(), SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), random_sign(), TorControlConnection::readcb(), run_ec_pubkey_parse_test(), run_eckey_edge_case_test(), run_ecmult_chain(), run_ecmult_multi_tests(), secp256k1_context_clone(), secp256k1_context_destroy(), secp256k1_context_randomize(), secp256k1_context_set_error_callback(), secp256k1_context_set_illegal_callback(), secp256k1_ec_privkey_negate(), secp256k1_ec_privkey_tweak_add(), secp256k1_ec_privkey_tweak_mul(), secp256k1_ec_pubkey_combine(), secp256k1_ec_pubkey_create(), secp256k1_ec_pubkey_negate(), secp256k1_ec_pubkey_parse(), secp256k1_ec_pubkey_serialize(), secp256k1_ec_pubkey_tweak_add(), secp256k1_ec_pubkey_tweak_mul(), secp256k1_ec_seckey_verify(), secp256k1_ecdh(), secp256k1_ecdsa_recover(), secp256k1_ecdsa_recoverable_signature_convert(), secp256k1_ecdsa_recoverable_signature_load(), secp256k1_ecdsa_recoverable_signature_parse_compact(), secp256k1_ecdsa_recoverable_signature_serialize_compact(), secp256k1_ecdsa_sig_recover(), secp256k1_ecdsa_sig_sign(), secp256k1_ecdsa_sig_verify(), secp256k1_ecdsa_sign(), secp256k1_ecdsa_sign_recoverable(), secp256k1_ecdsa_signature_load(), secp256k1_ecdsa_signature_normalize(), secp256k1_ecdsa_signature_parse_compact(), secp256k1_ecdsa_signature_parse_der(), secp256k1_ecdsa_signature_serialize_compact(), secp256k1_ecdsa_signature_serialize_der(), secp256k1_ecdsa_verify(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_eckey_pubkey_tweak_mul(), secp256k1_ecmult(), secp256k1_ecmult_context_build(), secp256k1_ecmult_context_clear(), secp256k1_ecmult_context_init(), secp256k1_ecmult_context_is_built(), secp256k1_ecmult_gen(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_gen_context_clear(), secp256k1_ecmult_gen_context_init(), secp256k1_ecmult_gen_context_is_built(), secp256k1_ecmult_multi_simple_var(), secp256k1_ecmult_multi_var(), secp256k1_ecmult_pippenger_batch(), secp256k1_ecmult_strauss_batch(), secp256k1_ecmult_strauss_wnaf(), secp256k1_scratch_space_create(), test_bad_scalar(), test_ec_combine(), test_ecdh_generator_basepoint(), test_ecdsa_der_parse(), test_ecdsa_edge_cases(), test_ecdsa_end_to_end(), test_ecdsa_recovery_api(), test_ecdsa_recovery_edge_cases(), test_ecdsa_recovery_end_to_end(), test_ecdsa_sign_verify(), test_ecmult_constants(), test_ecmult_gen_blind(), test_ecmult_gen_blind_reset(), test_ecmult_multi(), test_ecmult_multi_batching(), test_ecmult_multi_pippenger_max_points(), test_exhaustive_ecmult(), test_exhaustive_ecmult_multi(), test_exhaustive_sign(), test_exhaustive_verify(), test_ge(), test_point_times_order(), and OverviewPage::togglePrivateSend().