Bitcoin Core 31.99.0
P2P Digital Currency
Classes | Functions | Variables
tests_impl.h File Reference
#include "../../../include/secp256k1_silentpayments.h"
#include "../../unit_test.h"
#include "../../util.h"
#include "../../../src/modules/silentpayments/vectors.h"
Include dependency graph for tests_impl.h:

Go to the source code of this file.

Classes

struct  label_cache_entry
 Labels. More...
 
struct  labels_cache
 

Functions

const unsigned char * label_lookup (const unsigned char *key, const void *cache_ptr)
 
static void test_recipient_sort_helper (unsigned char(*sp_addresses[3])[2][33], unsigned char(*sp_outputs[3])[32])
 
static void test_recipient_sort (void)
 
static void test_send_api (void)
 
static void test_label_api (void)
 
static void test_recipient_api (void)
 
static void test_recipient_scan_label_precedes_direct_match (void)
 
void run_silentpayments_test_vector_send (const struct bip352_test_vector *test)
 
void run_silentpayments_test_vector_receive (const struct bip352_test_vector *test, const struct bip352_receive_subtest *subtest)
 
static void silentpayments_sha256_tag_test (void)
 
void run_silentpayments_test_vectors (void)
 

Variables

static unsigned char MALFORMED_SECKEY [32] = { 0x00 }
 Constants. More...
 
static unsigned char BOB_ADDRESS [2][33]
 
static unsigned char CAROL_ADDRESS [2][33]
 
static unsigned char BOB_OUTPUT [32]
 
static unsigned char CAROL_OUTPUT_ONE [32]
 
static unsigned char CAROL_OUTPUT_TWO [32]
 
static unsigned char SMALLEST_OUTPOINT [36]
 
static unsigned char ALICE_SECKEY [32]
 
struct labels_cache labels_cache
 
static const struct tf_test_entry tests_silentpayments []
 

Function Documentation

◆ label_lookup()

const unsigned char * label_lookup ( const unsigned char *  key,
const void *  cache_ptr 
)

Definition at line 98 of file tests_impl.h.

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

◆ run_silentpayments_test_vector_receive()

void run_silentpayments_test_vector_receive ( const struct bip352_test_vector test,
const struct bip352_receive_subtest subtest 
)

Definition at line 748 of file tests_impl.h.

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

◆ run_silentpayments_test_vector_send()

void run_silentpayments_test_vector_send ( const struct bip352_test_vector test)

Definition at line 668 of file tests_impl.h.

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

◆ run_silentpayments_test_vectors()

void run_silentpayments_test_vectors ( void  )

Definition at line 910 of file tests_impl.h.

Here is the call graph for this function:

◆ silentpayments_sha256_tag_test()

static void silentpayments_sha256_tag_test ( void  )
static

Definition at line 887 of file tests_impl.h.

Here is the call graph for this function:

◆ test_label_api()

static void test_label_api ( void  )
static

Definition at line 374 of file tests_impl.h.

Here is the call graph for this function:

◆ test_recipient_api()

static void test_recipient_api ( void  )
static

Definition at line 451 of file tests_impl.h.

Here is the call graph for this function:

◆ test_recipient_scan_label_precedes_direct_match()

static void test_recipient_scan_label_precedes_direct_match ( void  )
static

Definition at line 604 of file tests_impl.h.

Here is the call graph for this function:

◆ test_recipient_sort()

static void test_recipient_sort ( void  )
static

Definition at line 146 of file tests_impl.h.

Here is the call graph for this function:

◆ test_recipient_sort_helper()

static void test_recipient_sort_helper ( unsigned char(*[3])  sp_addresses[2][33],
unsigned char(*[3])  sp_outputs[32] 
)
static

Definition at line 114 of file tests_impl.h.

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

◆ test_send_api()

static void test_send_api ( void  )
static

Definition at line 182 of file tests_impl.h.

Here is the call graph for this function:

Variable Documentation

◆ ALICE_SECKEY

unsigned char ALICE_SECKEY[32]
static
Initial value:
= {
0xea, 0xdc, 0x78, 0x16, 0x5f, 0xf1, 0xf8, 0xea,
0x94, 0xad, 0x7c, 0xfd, 0xc5, 0x49, 0x90, 0x73,
0x8a, 0x4c, 0x53, 0xf6, 0xe0, 0x50, 0x7b, 0x42,
0x15, 0x42, 0x01, 0xb8, 0xe5, 0xdf, 0xf3, 0xb1
}

Definition at line 82 of file tests_impl.h.

◆ BOB_ADDRESS

unsigned char BOB_ADDRESS[2][33]
static
Initial value:
= {
{
0x02, 0x15, 0x40, 0xae, 0xa8, 0x97, 0x54, 0x7a,
0xd4, 0x39, 0xb4, 0xe0, 0xf6, 0x09, 0xe5, 0xf0,
0xfa, 0x63, 0xde, 0x89, 0xab, 0x11, 0xed, 0xe3,
0x1e, 0x8c, 0xde, 0x4b, 0xe2, 0x19, 0x42, 0x5f,
0x23
},
{
0x02, 0x3e, 0xff, 0xf8, 0x18, 0x51, 0x65, 0xea,
0x63, 0xa9, 0x92, 0xb3, 0x9f, 0x31, 0xd8, 0xfd,
0x8e, 0x0e, 0x64, 0xae, 0xf9, 0xd3, 0x88, 0x07,
0x34, 0x97, 0x37, 0x14, 0xa5, 0x3d, 0x83, 0x11,
0x8d
}
}

Definition at line 26 of file tests_impl.h.

◆ BOB_OUTPUT

unsigned char BOB_OUTPUT[32]
static
Initial value:
= {
0x46, 0x0d, 0x68, 0x08, 0x65, 0x64, 0x45, 0xee,
0x4d, 0x4e, 0xc0, 0x8e, 0xba, 0x8a, 0x66, 0xea,
0x66, 0x8e, 0x4e, 0x12, 0x98, 0x9a, 0x0e, 0x60,
0x4b, 0x5c, 0x36, 0x0e, 0x43, 0xf5, 0x5a, 0xfa
}

Definition at line 58 of file tests_impl.h.

◆ CAROL_ADDRESS

unsigned char CAROL_ADDRESS[2][33]
static
Initial value:
= {
{
0x03, 0xbb, 0xc6, 0x3f, 0x12, 0x74, 0x5d, 0x3b,
0x9e, 0x9d, 0x24, 0xc6, 0xcd, 0x7a, 0x1e, 0xfe,
0xba, 0xd0, 0xa7, 0xf4, 0x69, 0x23, 0x2f, 0xbe,
0xcf, 0x31, 0xfb, 0xa7, 0xb4, 0xf7, 0xdd, 0xed,
0xa8
},
{
0x03, 0x81, 0xeb, 0x9a, 0x9a, 0x9e, 0xc7, 0x39,
0xd5, 0x27, 0xc1, 0x63, 0x1b, 0x31, 0xb4, 0x21,
0x56, 0x6f, 0x5c, 0x2a, 0x47, 0xb4, 0xab, 0x5b,
0x1f, 0x6a, 0x68, 0x6d, 0xfb, 0x68, 0xea, 0xb7,
0x16
}
}

Definition at line 42 of file tests_impl.h.

◆ CAROL_OUTPUT_ONE

unsigned char CAROL_OUTPUT_ONE[32]
static
Initial value:
= {
0x4b, 0x81, 0x34, 0x5d, 0x53, 0x89, 0xba, 0xa3,
0xd8, 0x93, 0xe2, 0xfb, 0xe7, 0x08, 0xdd, 0x6d,
0x82, 0xdc, 0xd8, 0x49, 0xab, 0x03, 0xc1, 0xdb,
0x68, 0xbe, 0xc7, 0xe9, 0x2a, 0x45, 0xfa, 0xc5
}

Definition at line 64 of file tests_impl.h.

◆ CAROL_OUTPUT_TWO

unsigned char CAROL_OUTPUT_TWO[32]
static
Initial value:
= {
0xb7, 0xf3, 0xc6, 0x79, 0x30, 0x4a, 0xef, 0x8c,
0xc0, 0xc7, 0x61, 0xf1, 0x00, 0x99, 0xdd, 0x7b,
0x20, 0x65, 0x20, 0xd7, 0x11, 0x6f, 0xb7, 0x91,
0xee, 0x74, 0x54, 0xa2, 0xfc, 0x22, 0x79, 0xf4
}

Definition at line 70 of file tests_impl.h.

◆ labels_cache

Definition at line 97 of file tests_impl.h.

◆ MALFORMED_SECKEY

unsigned char MALFORMED_SECKEY[32] = { 0x00 }
static

Constants.

Malformed Seckey: a seckey that is all zeros Addresses: scan and spend public keys for Bob and Carol Outputs: generated outputs from Alice's secret key and Bob/Carol's scan public keys Smallest Outpoint: smallest outpoint lexicographically from the transaction Seckey: secret key for Alice

The values themselves are not important.

Definition at line 25 of file tests_impl.h.

◆ SMALLEST_OUTPOINT

unsigned char SMALLEST_OUTPOINT[36]
static
Initial value:
= {
0x16, 0x9e, 0x1e, 0x83, 0xe9, 0x30, 0x85, 0x33, 0x91,
0xbc, 0x6f, 0x35, 0xf6, 0x05, 0xc6, 0x75, 0x4c, 0xfe,
0xad, 0x57, 0xcf, 0x83, 0x87, 0x63, 0x9d, 0x3b, 0x40,
0x96, 0xc5, 0x4f, 0x18, 0xf4, 0x00, 0x00, 0x00, 0x00
}

Definition at line 76 of file tests_impl.h.

◆ tests_silentpayments

const struct tf_test_entry tests_silentpayments[]
static
Initial value:
= {
}
static void test_recipient_sort(void)
Definition: tests_impl.h:146
static void test_recipient_scan_label_precedes_direct_match(void)
Definition: tests_impl.h:604
static void test_label_api(void)
Definition: tests_impl.h:374
void run_silentpayments_test_vectors(void)
Definition: tests_impl.h:910
static void test_recipient_api(void)
Definition: tests_impl.h:451
static void test_send_api(void)
Definition: tests_impl.h:182
static void silentpayments_sha256_tag_test(void)
Definition: tests_impl.h:887
#define CASE1(name)
Definition: unit_test.h:27

Definition at line 923 of file tests_impl.h.