@@ -52,14 +52,6 @@ static uint8_t _mock_bip39_seed[64] = {
52
52
0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 ,
53
53
};
54
54
55
- static const uint32_t _keypath [] = {
56
- 44 + BIP32_INITIAL_HARDENED_CHILD ,
57
- 0 + BIP32_INITIAL_HARDENED_CHILD ,
58
- 0 + BIP32_INITIAL_HARDENED_CHILD ,
59
- 0 ,
60
- 5 ,
61
- };
62
-
63
55
// Same as Python:
64
56
// import hmac, hashlib; hmac.digest(b"unit-test", b"password", hashlib.sha256).hex()
65
57
// See also: securechip_mock.c
@@ -112,39 +104,6 @@ void _mock_unlocked(const uint8_t* seed, size_t seed_len, const uint8_t* bip39_s
112
104
keystore_mock_unlocked (seed , seed_len , bip39_seed );
113
105
}
114
106
115
- static void _test_keystore_secp256k1_nonce_commit (void * * state )
116
- {
117
- uint8_t msg [32 ] = {0 };
118
- memset (msg , 0x88 , sizeof (msg ));
119
- uint8_t client_commitment [EC_PUBLIC_KEY_LEN ] = {0 };
120
- uint8_t host_commitment [32 ] = {0 };
121
- memset (host_commitment , 0xAB , sizeof (host_commitment ));
122
-
123
- {
124
- _mock_unlocked (NULL , 0 , NULL );
125
- // fails because keystore is locked
126
- assert_false (keystore_secp256k1_nonce_commit (
127
- _keypath ,
128
- sizeof (_keypath ) / sizeof (uint32_t ),
129
- msg ,
130
- host_commitment ,
131
- client_commitment ));
132
- }
133
- {
134
- _mock_unlocked (_mock_seed , sizeof (_mock_seed ), _mock_bip39_seed );
135
- assert_true (keystore_secp256k1_nonce_commit (
136
- _keypath ,
137
- sizeof (_keypath ) / sizeof (uint32_t ),
138
- msg ,
139
- host_commitment ,
140
- client_commitment ));
141
- const uint8_t expected_commitment [EC_PUBLIC_KEY_LEN ] =
142
- "\x02\xfd\xcf\x79\xf9\xc0\x3f\x6a\xcc\xc6\x56\x95\xa1\x90\x82\xe3\x0b\xfb\x9e\xdc\x93"
143
- "\x04\x5a\x03\x05\x8a\x99\x09\xe4\x9b\x1a\x37\x7b" ;
144
- assert_memory_equal (expected_commitment , client_commitment , sizeof (client_commitment ));
145
- }
146
- }
147
-
148
107
static void _expect_encrypt_and_store_seed (void )
149
108
{
150
109
will_return (__wrap_memory_is_initialized , false);
@@ -323,7 +282,6 @@ int main(void)
323
282
mock_memory_set_salt_root (_salt_root );
324
283
325
284
const struct CMUnitTest tests [] = {
326
- cmocka_unit_test (_test_keystore_secp256k1_nonce_commit ),
327
285
cmocka_unit_test (_test_keystore_lock ),
328
286
cmocka_unit_test (_test_keystore_create_and_store_seed ),
329
287
cmocka_unit_test (_test_secp256k1_schnorr_sign ),
0 commit comments