@@ -72,6 +72,18 @@ static void _test_keystore_antiklepto(void** state)
72
72
host_nonce [0 ] = i ;
73
73
uint8_t host_nonce_commitment [32 ];
74
74
75
+ // Get pubkey at keypath
76
+ struct ext_key xprv_master = {0 };
77
+ struct ext_key xprv_derived = {0 };
78
+ assert_int_equal (
79
+ bip32_key_from_seed (
80
+ _mock_bip39_seed , BIP32_ENTROPY_LEN_512 , BIP32_VER_MAIN_PRIVATE , 0 , & xprv_master ),
81
+ WALLY_OK );
82
+ assert_int_equal (
83
+ bip32_key_from_parent_path (
84
+ & xprv_master , keypath , 5 , BIP32_FLAG_KEY_PRIVATE , & xprv_derived ),
85
+ WALLY_OK );
86
+
75
87
// Protocol steps are described in secp256k1/include/secp256k1_ecdsa_s2c.h under "ECDSA
76
88
// Anti-Klepto Protocol".
77
89
@@ -90,11 +102,13 @@ static void _test_keystore_antiklepto(void** state)
90
102
secp256k1_ecdsa_signature parsed_signature ;
91
103
assert_true (secp256k1_ecdsa_signature_parse_compact (
92
104
wally_get_secp_context (), & parsed_signature , sig ));
93
- struct ext_key xpub ;
94
- assert_true (keystore_get_xpub (keypath , 5 , & xpub ));
105
+
95
106
secp256k1_pubkey parsed_pubkey ;
96
107
assert_true (secp256k1_ec_pubkey_parse (
97
- wally_get_secp_context (), & parsed_pubkey , xpub .pub_key , sizeof (xpub .pub_key )));
108
+ wally_get_secp_context (),
109
+ & parsed_pubkey ,
110
+ xprv_derived .pub_key ,
111
+ sizeof (xprv_derived .pub_key )));
98
112
secp256k1_ecdsa_s2c_opening opening ;
99
113
assert_true (secp256k1_ecdsa_s2c_opening_parse (
100
114
wally_get_secp_context (), & opening , signer_commitment ));
0 commit comments