Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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 "../../unit_test.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_internal (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 (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_internal (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)

Variables

static const struct tf_test_entry tests_musig []

Function Documentation

◆ create_keypair_and_pk()

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

Definition at line 27 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 112 of file tests_impl.h.

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

◆ musig_api_tests()

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 122 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_nonce_bitflip()

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

Definition at line 508 of file tests_impl.h.

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

◆ musig_nonce_test()

void musig_nonce_test ( void )
static

Definition at line 518 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_simple_test_internal()

void musig_simple_test_internal ( void )
static

Definition at line 40 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_set_secnonce()

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

Definition at line 875 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()

void musig_test_static_nonce_gen_counter ( void )
static

Definition at line 1093 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_keyagg()

void musig_test_vectors_keyagg ( void )
static

Definition at line 768 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_nonceagg()

void musig_test_vectors_nonceagg ( void )
static

Definition at line 845 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_noncegen()

void musig_test_vectors_noncegen ( void )
static

Definition at line 792 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_sigagg()

void musig_test_vectors_sigagg ( void )
static

Definition at line 1051 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_signverify()

void musig_test_vectors_signverify ( void )
static

Definition at line 885 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_test_vectors_tweak()

void musig_test_vectors_tweak ( void )
static

Definition at line 1008 of file tests_impl.h.

Here is the call graph for this function:

◆ musig_tweak_test_helper()

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 611 of file tests_impl.h.

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

◆ musig_tweak_test_internal()

void musig_tweak_test_internal ( void )
static

Definition at line 654 of file tests_impl.h.

Here is the call 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 707 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()

void pubnonce_summing_to_inf ( secp256k1_musig_pubnonce * pubnonce)
static

Definition at line 91 of file tests_impl.h.

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

◆ sha256_tag_test()

void sha256_tag_test ( void )
static

Definition at line 575 of file tests_impl.h.

Here is the call graph for this function:

Variable Documentation

◆ tests_musig

const struct tf_test_entry tests_musig[]
static
Initial value:
= {
CASE1(musig_simple_test),
CASE1(musig_tweak_test),
}
static void musig_test_vectors_keyagg(void)
Definition tests_impl.h:768
static void musig_nonce_test(void)
Definition tests_impl.h:518
static void sha256_tag_test(void)
Definition tests_impl.h:575
static void musig_api_tests(void)
Definition tests_impl.h:122
static void musig_test_vectors_sigagg(void)
static void musig_test_vectors_signverify(void)
Definition tests_impl.h:885
static void musig_test_static_nonce_gen_counter(void)
static void musig_test_vectors_nonceagg(void)
Definition tests_impl.h:845
static void musig_test_vectors_noncegen(void)
Definition tests_impl.h:792
static void musig_test_vectors_tweak(void)
#define CASE1(name)
Definition unit_test.h:25

Definition at line 1144 of file tests_impl.h.