Bitcoin Core 29.99.0
P2P Digital Currency
Functions | Variables
tests_wycheproof_generate_ecdh Namespace Reference

Functions

def should_skip_flags (test_vector_flags)
 
def should_skip_tcid (test_vector_tcid)
 
def parse_der_pk (s)
 
def parse_public_key (pk)
 
def normalize_private_key (sk)
 
def normalize_expected_result (er)
 

Variables

 filename_input = sys.argv[1]
 
 doc = json.load(f)
 
int num_vectors = 0
 
 offset_sk_running
 
 offset_pk_running
 
 offset_shared
 
string test_vectors_out = ""
 
string private_keys = ""
 
string shared_secrets = ""
 
string public_keys = ""
 
dictionary cache_sks = {}
 
dictionary cache_public_keys = {}
 
def public_key = parse_public_key(test_vector['public'])
 
def private_key = normalize_private_key(test_vector['private'])
 
def expected_result = normalize_expected_result(test_vector['result'])
 
int shared_size = len(test_vector['shared']) // 2
 
int sk_size = len(private_key) // 2
 
int pk_size = len(public_key) // 2
 
bool new_sk = False
 
 sk = to_c_array(private_key)
 
 sk_offset = offset_sk_running
 
bool new_pk = False
 
def pk = '0x' else ''
 
 pk_offset = offset_pk_running
 
 wycheproof_tcid = test_vector['tcId']
 
string struct_definition
 

Function Documentation

◆ normalize_expected_result()

def tests_wycheproof_generate_ecdh.normalize_expected_result (   er)

Definition at line 66 of file tests_wycheproof_generate_ecdh.py.

◆ normalize_private_key()

def tests_wycheproof_generate_ecdh.normalize_private_key (   sk)

Definition at line 58 of file tests_wycheproof_generate_ecdh.py.

◆ parse_der_pk()

def tests_wycheproof_generate_ecdh.parse_der_pk (   s)

Definition at line 30 of file tests_wycheproof_generate_ecdh.py.

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

◆ parse_public_key()

def tests_wycheproof_generate_ecdh.parse_public_key (   pk)

Definition at line 54 of file tests_wycheproof_generate_ecdh.py.

Here is the call graph for this function:

◆ should_skip_flags()

def tests_wycheproof_generate_ecdh.should_skip_flags (   test_vector_flags)

Definition at line 15 of file tests_wycheproof_generate_ecdh.py.

◆ should_skip_tcid()

def tests_wycheproof_generate_ecdh.should_skip_tcid (   test_vector_tcid)

Definition at line 21 of file tests_wycheproof_generate_ecdh.py.

Variable Documentation

◆ cache_public_keys

dictionary tests_wycheproof_generate_ecdh.cache_public_keys = {}

Definition at line 82 of file tests_wycheproof_generate_ecdh.py.

◆ cache_sks

dictionary tests_wycheproof_generate_ecdh.cache_sks = {}

Definition at line 81 of file tests_wycheproof_generate_ecdh.py.

◆ doc

tests_wycheproof_generate_ecdh.doc = json.load(f)

Definition at line 73 of file tests_wycheproof_generate_ecdh.py.

◆ expected_result

def tests_wycheproof_generate_ecdh.expected_result = normalize_expected_result(test_vector['result'])

Definition at line 93 of file tests_wycheproof_generate_ecdh.py.

◆ filename_input

tests_wycheproof_generate_ecdh.filename_input = sys.argv[1]

Definition at line 70 of file tests_wycheproof_generate_ecdh.py.

◆ new_pk

bool tests_wycheproof_generate_ecdh.new_pk = False

Definition at line 114 of file tests_wycheproof_generate_ecdh.py.

◆ new_sk

bool tests_wycheproof_generate_ecdh.new_sk = False

Definition at line 100 of file tests_wycheproof_generate_ecdh.py.

◆ num_vectors

int tests_wycheproof_generate_ecdh.num_vectors = 0

Definition at line 75 of file tests_wycheproof_generate_ecdh.py.

◆ offset_pk_running

tests_wycheproof_generate_ecdh.offset_pk_running

Definition at line 76 of file tests_wycheproof_generate_ecdh.py.

◆ offset_shared

tests_wycheproof_generate_ecdh.offset_shared

Definition at line 76 of file tests_wycheproof_generate_ecdh.py.

◆ offset_sk_running

tests_wycheproof_generate_ecdh.offset_sk_running

Definition at line 76 of file tests_wycheproof_generate_ecdh.py.

◆ pk

def tests_wycheproof_generate_ecdh.pk = '0x' else ''

Definition at line 115 of file tests_wycheproof_generate_ecdh.py.

◆ pk_offset

dictionary tests_wycheproof_generate_ecdh.pk_offset = offset_pk_running

Definition at line 117 of file tests_wycheproof_generate_ecdh.py.

◆ pk_size

int tests_wycheproof_generate_ecdh.pk_size = len(public_key) // 2

Definition at line 98 of file tests_wycheproof_generate_ecdh.py.

◆ private_key

def tests_wycheproof_generate_ecdh.private_key = normalize_private_key(test_vector['private'])

Definition at line 92 of file tests_wycheproof_generate_ecdh.py.

◆ private_keys

string tests_wycheproof_generate_ecdh.private_keys = ""

Definition at line 78 of file tests_wycheproof_generate_ecdh.py.

◆ public_key

def tests_wycheproof_generate_ecdh.public_key = parse_public_key(test_vector['public'])

Definition at line 91 of file tests_wycheproof_generate_ecdh.py.

◆ public_keys

string tests_wycheproof_generate_ecdh.public_keys = ""

Definition at line 80 of file tests_wycheproof_generate_ecdh.py.

◆ shared_secrets

string tests_wycheproof_generate_ecdh.shared_secrets = ""

Definition at line 79 of file tests_wycheproof_generate_ecdh.py.

◆ shared_size

int tests_wycheproof_generate_ecdh.shared_size = len(test_vector['shared']) // 2

Definition at line 96 of file tests_wycheproof_generate_ecdh.py.

◆ sk

tests_wycheproof_generate_ecdh.sk = to_c_array(private_key)

Definition at line 101 of file tests_wycheproof_generate_ecdh.py.

◆ sk_offset

dictionary tests_wycheproof_generate_ecdh.sk_offset = offset_sk_running

Definition at line 102 of file tests_wycheproof_generate_ecdh.py.

◆ sk_size

int tests_wycheproof_generate_ecdh.sk_size = len(private_key) // 2

Definition at line 97 of file tests_wycheproof_generate_ecdh.py.

◆ struct_definition

string tests_wycheproof_generate_ecdh.struct_definition
Initial value:
1= """
2typedef struct {
3 size_t pk_offset;
4 size_t pk_len;
5 size_t sk_offset;
6 size_t sk_len;
7 size_t shared_offset;
8 size_t shared_len;
9 int expected_result;
10 int wycheproof_tcid;
11} wycheproof_ecdh_testvector;
12"""

Definition at line 142 of file tests_wycheproof_generate_ecdh.py.

◆ test_vectors_out

string tests_wycheproof_generate_ecdh.test_vectors_out = ""

Definition at line 77 of file tests_wycheproof_generate_ecdh.py.

◆ wycheproof_tcid

tests_wycheproof_generate_ecdh.wycheproof_tcid = test_vector['tcId']

Definition at line 131 of file tests_wycheproof_generate_ecdh.py.