Bitcoin Core 30.99.0
P2P Digital Currency
Macros | Functions | Variables
tests_impl.h File Reference
#include "../../../include/secp256k1_schnorrsig.h"
#include "../../unit_test.h"
Include dependency graph for tests_impl.h:

Go to the source code of this file.

Macros

#define N_SIGS   3
 

Functions

static void nonce_function_bip340_bitflip (unsigned char **args, size_t n_flip, size_t n_bytes, size_t msglen, size_t algolen)
 
static void run_nonce_function_bip340_tests (void)
 
static void test_schnorrsig_api (void)
 
static void test_schnorrsig_sha256_tagged (void)
 
static void test_schnorrsig_bip_vectors_check_signing (const unsigned char *sk, const unsigned char *pk_serialized, const unsigned char *aux_rand, const unsigned char *msg, size_t msglen, const unsigned char *expected_sig)
 
static void test_schnorrsig_bip_vectors_check_verify (const unsigned char *pk_serialized, const unsigned char *msg, size_t msglen, const unsigned char *sig, int expected)
 
static void test_schnorrsig_bip_vectors (void)
 
static int nonce_function_failing (unsigned char *nonce32, const unsigned char *msg, size_t msglen, const unsigned char *key32, const unsigned char *xonly_pk32, const unsigned char *algo, size_t algolen, void *data)
 
static int nonce_function_0 (unsigned char *nonce32, const unsigned char *msg, size_t msglen, const unsigned char *key32, const unsigned char *xonly_pk32, const unsigned char *algo, size_t algolen, void *data)
 
static int nonce_function_overflowing (unsigned char *nonce32, const unsigned char *msg, size_t msglen, const unsigned char *key32, const unsigned char *xonly_pk32, const unsigned char *algo, size_t algolen, void *data)
 
static void test_schnorrsig_sign_internal (void)
 
static void test_schnorrsig_sign_verify_internal (void)
 
static void test_schnorrsig_taproot (void)
 

Variables

static const struct tf_test_entry tests_schnorrsig []
 

Macro Definition Documentation

◆ N_SIGS

#define N_SIGS   3

Definition at line 852 of file tests_impl.h.

Function Documentation

◆ nonce_function_0()

static int nonce_function_0 ( unsigned char *  nonce32,
const unsigned char *  msg,
size_t  msglen,
const unsigned char *  key32,
const unsigned char *  xonly_pk32,
const unsigned char *  algo,
size_t  algolen,
void *  data 
)
static

Definition at line 779 of file tests_impl.h.

Here is the caller graph for this function:

◆ nonce_function_bip340_bitflip()

static void nonce_function_bip340_bitflip ( unsigned char **  args,
size_t  n_flip,
size_t  n_bytes,
size_t  msglen,
size_t  algolen 
)
static

Definition at line 16 of file tests_impl.h.

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

◆ nonce_function_failing()

static int nonce_function_failing ( unsigned char *  nonce32,
const unsigned char *  msg,
size_t  msglen,
const unsigned char *  key32,
const unsigned char *  xonly_pk32,
const unsigned char *  algo,
size_t  algolen,
void *  data 
)
static

Definition at line 766 of file tests_impl.h.

Here is the caller graph for this function:

◆ nonce_function_overflowing()

static int nonce_function_overflowing ( unsigned char *  nonce32,
const unsigned char *  msg,
size_t  msglen,
const unsigned char *  key32,
const unsigned char *  xonly_pk32,
const unsigned char *  algo,
size_t  algolen,
void *  data 
)
static

Definition at line 793 of file tests_impl.h.

Here is the caller graph for this function:

◆ run_nonce_function_bip340_tests()

static void run_nonce_function_bip340_tests ( void  )
static

Definition at line 24 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_api()

static void test_schnorrsig_api ( void  )
static

main test body

Definition at line 107 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_bip_vectors()

static void test_schnorrsig_bip_vectors ( void  )
static

Definition at line 207 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_bip_vectors_check_signing()

static void test_schnorrsig_bip_vectors_check_signing ( const unsigned char *  sk,
const unsigned char *  pk_serialized,
const unsigned char *  aux_rand,
const unsigned char *  msg,
size_t  msglen,
const unsigned char *  expected_sig 
)
static

Definition at line 173 of file tests_impl.h.

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

◆ test_schnorrsig_bip_vectors_check_verify()

static void test_schnorrsig_bip_vectors_check_verify ( const unsigned char *  pk_serialized,
const unsigned char *  msg,
size_t  msglen,
const unsigned char *  sig,
int  expected 
)
static

Definition at line 198 of file tests_impl.h.

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

◆ test_schnorrsig_sha256_tagged()

static void test_schnorrsig_sha256_tagged ( void  )
static

Definition at line 161 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_sign_internal()

static void test_schnorrsig_sign_internal ( void  )
static

Definition at line 806 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_sign_verify_internal()

static void test_schnorrsig_sign_verify_internal ( void  )
static

Definition at line 856 of file tests_impl.h.

Here is the call graph for this function:

◆ test_schnorrsig_taproot()

static void test_schnorrsig_taproot ( void  )
static

Definition at line 933 of file tests_impl.h.

Here is the call graph for this function:

Variable Documentation

◆ tests_schnorrsig

const struct tf_test_entry tests_schnorrsig[]
static
Initial value:
= {
CASE(nonce_function_bip340_tests),
CASE1(test_schnorrsig_sign),
CASE1(test_schnorrsig_sign_verify),
}
static void test_schnorrsig_api(void)
Definition: tests_impl.h:107
static void test_schnorrsig_taproot(void)
Definition: tests_impl.h:933
static void test_schnorrsig_bip_vectors(void)
Definition: tests_impl.h:207
static void test_schnorrsig_sha256_tagged(void)
Definition: tests_impl.h:161
#define CASE1(name)
Definition: unit_test.h:25
#define CASE(name)
Definition: unit_test.h:24

Definition at line 973 of file tests_impl.h.