Bitcoin Core 28.99.0
P2P Digital Currency
Functions
tests_impl.h File Reference
#include <stdlib.h>
#include <string.h>
#include "../../../include/secp256k1.h"
#include "../../../include/secp256k1_extrakeys.h"
#include "../../../include/secp256k1_musig.h"
#include "session.h"
#include "keyagg.h"
#include "../../scalar.h"
#include "../../field.h"
#include "../../group.h"
#include "../../hash.h"
#include "../../util.h"
#include "vectors.h"
Include dependency graph for tests_impl.h:

Go to the source code of this file.

Functions

static int create_keypair_and_pk (secp256k1_keypair *keypair, secp256k1_pubkey *pk, const unsigned char *sk)
 
static void musig_simple_test (void)
 
static void pubnonce_summing_to_inf (secp256k1_musig_pubnonce *pubnonce)
 
int memcmp_and_randomize (unsigned char *value, const unsigned char *expected, size_t len)
 
static void musig_api_tests (void)
 
static void musig_nonce_bitflip (unsigned char **args, size_t n_flip, size_t n_bytes)
 
static void musig_nonce_test (void)
 
static void sha256_tag_test_internal (secp256k1_sha256 *sha_tagged, unsigned char *tag, size_t taglen)
 
static void sha256_tag_test (void)
 
static void musig_tweak_test_helper (const secp256k1_xonly_pubkey *agg_pk, const unsigned char *sk0, const unsigned char *sk1, secp256k1_musig_keyagg_cache *keyagg_cache)
 
static void musig_tweak_test (void)
 
int musig_vectors_keyagg_and_tweak (enum MUSIG_ERROR *error, secp256k1_musig_keyagg_cache *keyagg_cache, unsigned char *agg_pk_ser, const unsigned char pubkeys33[][33], const unsigned char tweaks32[][32], size_t key_indices_len, const size_t *key_indices, size_t tweak_indices_len, const size_t *tweak_indices, const int *is_xonly)
 
static void musig_test_vectors_keyagg (void)
 
static void musig_test_vectors_noncegen (void)
 
static void musig_test_vectors_nonceagg (void)
 
static void musig_test_set_secnonce (secp256k1_musig_secnonce *secnonce, const unsigned char *secnonce64, const secp256k1_pubkey *pubkey)
 
static void musig_test_vectors_signverify (void)
 
static void musig_test_vectors_tweak (void)
 
static void musig_test_vectors_sigagg (void)
 
static void musig_test_static_nonce_gen_counter (void)
 
static void run_musig_tests (void)
 

Function Documentation

◆ create_keypair_and_pk()

static int create_keypair_and_pk ( secp256k1_keypair keypair,
secp256k1_pubkey pk,
const unsigned char *  sk 
)
static

Definition at line 26 of file tests_impl.h.

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

◆ memcmp_and_randomize()

int memcmp_and_randomize ( unsigned char *  value,
const unsigned char *  expected,
size_t  len 
)

Definition at line 111 of file tests_impl.h.

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

◆ musig_api_tests()

static void musig_api_tests ( void  )
static

setup

main test body

Key aggregation

Tweaking

Session creation with nonce_gen

Session creation with nonce_gen_counter

Serialize and parse public nonces

Receive nonces and aggregate

Serialize and parse aggregate nonces

Process nonces

Partial signature verification

Signature aggregation and verification

Definition at line 121 of file tests_impl.h.

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

◆ musig_nonce_bitflip()

static void musig_nonce_bitflip ( unsigned char **  args,
size_t  n_flip,
size_t  n_bytes 
)
static

Definition at line 486 of file tests_impl.h.

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

◆ musig_nonce_test()

static void musig_nonce_test ( void  )
static

Definition at line 496 of file tests_impl.h.

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

◆ musig_simple_test()

static void musig_simple_test ( void  )
static

Definition at line 39 of file tests_impl.h.

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

◆ musig_test_set_secnonce()

static void musig_test_set_secnonce ( secp256k1_musig_secnonce secnonce,
const unsigned char *  secnonce64,
const secp256k1_pubkey pubkey 
)
static

Definition at line 854 of file tests_impl.h.

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

◆ musig_test_static_nonce_gen_counter()

static void musig_test_static_nonce_gen_counter ( void  )
static

Definition at line 1073 of file tests_impl.h.

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

◆ musig_test_vectors_keyagg()

static void musig_test_vectors_keyagg ( void  )
static

Definition at line 747 of file tests_impl.h.

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

◆ musig_test_vectors_nonceagg()

static void musig_test_vectors_nonceagg ( void  )
static

Definition at line 824 of file tests_impl.h.

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

◆ musig_test_vectors_noncegen()

static void musig_test_vectors_noncegen ( void  )
static

Definition at line 771 of file tests_impl.h.

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

◆ musig_test_vectors_sigagg()

static void musig_test_vectors_sigagg ( void  )
static

Definition at line 1031 of file tests_impl.h.

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

◆ musig_test_vectors_signverify()

static void musig_test_vectors_signverify ( void  )
static

Definition at line 864 of file tests_impl.h.

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

◆ musig_test_vectors_tweak()

static void musig_test_vectors_tweak ( void  )
static

Definition at line 988 of file tests_impl.h.

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

◆ musig_tweak_test()

static void musig_tweak_test ( void  )
static

Definition at line 633 of file tests_impl.h.

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

◆ musig_tweak_test_helper()

static void musig_tweak_test_helper ( const secp256k1_xonly_pubkey agg_pk,
const unsigned char *  sk0,
const unsigned char *  sk1,
secp256k1_musig_keyagg_cache keyagg_cache 
)
static

Definition at line 590 of file tests_impl.h.

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

◆ musig_vectors_keyagg_and_tweak()

int musig_vectors_keyagg_and_tweak ( enum MUSIG_ERROR error,
secp256k1_musig_keyagg_cache keyagg_cache,
unsigned char *  agg_pk_ser,
const unsigned char  pubkeys33[][33],
const unsigned char  tweaks32[][32],
size_t  key_indices_len,
const size_t *  key_indices,
size_t  tweak_indices_len,
const size_t *  tweak_indices,
const int *  is_xonly 
)

Definition at line 686 of file tests_impl.h.

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

◆ pubnonce_summing_to_inf()

static void pubnonce_summing_to_inf ( secp256k1_musig_pubnonce pubnonce)
static

Definition at line 90 of file tests_impl.h.

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

◆ run_musig_tests()

static void run_musig_tests ( void  )
static

Definition at line 1119 of file tests_impl.h.

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

◆ sha256_tag_test()

static void sha256_tag_test ( void  )
static

Definition at line 559 of file tests_impl.h.

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

◆ sha256_tag_test_internal()

static void sha256_tag_test_internal ( secp256k1_sha256 sha_tagged,
unsigned char *  tag,
size_t  taglen 
)
static

Definition at line 551 of file tests_impl.h.

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