@@ -118,7 +118,7 @@ static bool _encode_xpub(const struct ext_key* xpub, char* out, size_t out_len)
118
118
rust_util_bytes (bytes , sizeof (bytes )), rust_util_bytes_mut ((uint8_t * )out , out_len ));
119
119
}
120
120
121
- static void _check_pubs (const char * expected_xpub , const char * expected_pubkey_uncompressed_hex )
121
+ static void _check_pubs (const char * expected_xpub )
122
122
{
123
123
struct ext_key __attribute__((__cleanup__ (keystore_zero_xkey ))) xpub_3 ;
124
124
struct ext_key __attribute__((__cleanup__ (keystore_zero_xkey ))) xpub_5 ;
@@ -135,19 +135,13 @@ static void _check_pubs(const char* expected_xpub, const char* expected_pubkey_u
135
135
char xpub_serialized [120 ];
136
136
assert_true (_encode_xpub (& xpub_3 , xpub_serialized , sizeof (xpub_serialized )));
137
137
assert_string_equal (xpub_serialized , expected_xpub );
138
-
139
- uint8_t pubkey_uncompressed [EC_PUBLIC_KEY_UNCOMPRESSED_LEN ];
140
- assert_true (keystore_secp256k1_compressed_to_uncompressed (xpub_5 .pub_key , pubkey_uncompressed ));
141
- _assert_equal_memory_hex (
142
- pubkey_uncompressed , sizeof (pubkey_uncompressed ), expected_pubkey_uncompressed_hex );
143
138
}
144
139
145
140
static void _test_combination (
146
141
const char * mnemonic_passphrase ,
147
142
uint32_t seed_len ,
148
143
const char * expected_mnemonic ,
149
144
const char * expected_xpub ,
150
- const char * expected_pubkey_uncompressed_hex ,
151
145
const char * expected_u2f_seed_hex )
152
146
{
153
147
assert_false (keystore_unlock_bip39 (mnemonic_passphrase ));
@@ -163,7 +157,7 @@ static void _test_combination(
163
157
assert_true (keystore_unlock_bip39 (mnemonic_passphrase ));
164
158
assert_false (keystore_is_locked ());
165
159
_check_mnemonic (expected_mnemonic );
166
- _check_pubs (expected_xpub , expected_pubkey_uncompressed_hex );
160
+ _check_pubs (expected_xpub );
167
161
168
162
uint8_t u2f_seed [32 ];
169
163
assert_true (keystore_get_u2f_seed (u2f_seed ));
@@ -182,18 +176,10 @@ static void _test_fixtures(void** state)
182
176
const char * expected_xpub =
183
177
"xpub6Cj6NNCGj2CRPHvkuEG1rbW3nrNCAnLjaoTg1P67FCGoahSsbg9WQ7YaMEEP83QDxt2kZ3hTPAPpGdyEZc"
184
178
"fAC1C75HfR66UbjpAb39f4PnG" ;
185
- const char * expected_pubkey_uncompressed_hex =
186
- "0477a44aa9e8c8fb5105ef5ee2394e8aed89ad73fc74361425f06347ecfe326131e1339367ee3cbe877192"
187
- "85a07f774b17eb933ecf0b9b82acebc195226d634244" ;
188
179
const char * expected_u2f_seed_hex =
189
180
"4f464a6667ad88eebcd0f02982761e474ee0dd16253160320f49d1d6681745e9" ;
190
181
_test_combination (
191
- mnemonic_passphrase ,
192
- seed_len ,
193
- expected_mnemonic ,
194
- expected_xpub ,
195
- expected_pubkey_uncompressed_hex ,
196
- expected_u2f_seed_hex );
182
+ mnemonic_passphrase , seed_len , expected_mnemonic , expected_xpub , expected_u2f_seed_hex );
197
183
}
198
184
{
199
185
const char * mnemonic_passphrase = "abc" ;
@@ -204,18 +190,10 @@ static void _test_fixtures(void** state)
204
190
const char * expected_xpub =
205
191
"xpub6DXBP3HhFdhUTafatEULxfTXUUxDVuCxfa9RAiBU5r6aRgKiABbeBDyqwWWjmKPP1BZvpvVNMbVR5LeHzh"
206
192
"QphtLcPZ8jk3MdLBgc2sACJwR" ;
207
- const char * expected_pubkey_uncompressed_hex =
208
- "044fb66eeefd352b441c86a6200a1e871928a367f5ab5f46566645d01d0534791ae39ff64a7d14d2427297"
209
- "61ebd3829e8536b389dba543cbc48b1d86c01559d27b" ;
210
193
const char * expected_u2f_seed_hex =
211
194
"d599da991ad83baaf449c789e2dff1539dd66983b47a1dec1c00ff3f352cccbc" ;
212
195
_test_combination (
213
- mnemonic_passphrase ,
214
- seed_len ,
215
- expected_mnemonic ,
216
- expected_xpub ,
217
- expected_pubkey_uncompressed_hex ,
218
- expected_u2f_seed_hex );
196
+ mnemonic_passphrase , seed_len , expected_mnemonic , expected_xpub , expected_u2f_seed_hex );
219
197
}
220
198
{
221
199
const char * mnemonic_passphrase = "" ;
@@ -226,18 +204,10 @@ static void _test_fixtures(void** state)
226
204
const char * expected_xpub =
227
205
"xpub6C7fKxGtTzEVxCC22U2VHx4GpaVy77DzU6KdZ1CLuHgoUGviBMWDc62uoQVxqcRa5RQbMPnffjpwxve18B"
228
206
"G81VJhJDXnSpRe5NGKwVpXiAb" ;
229
- const char * expected_pubkey_uncompressed_hex =
230
- "043113631363e62a07d6a0becafc8063bb311fd1e9e71a6930d995857837642648aba5c743374e19428565"
231
- "80f565c6b929737af5439f65f5333baf1d63c1f986bf" ;
232
207
const char * expected_u2f_seed_hex =
233
208
"fb9dc3fb0a17390776df5c3d8f9261bc5fd5df9f00414cee1393e37e0efda7ef" ;
234
209
_test_combination (
235
- mnemonic_passphrase ,
236
- seed_len ,
237
- expected_mnemonic ,
238
- expected_xpub ,
239
- expected_pubkey_uncompressed_hex ,
240
- expected_u2f_seed_hex );
210
+ mnemonic_passphrase , seed_len , expected_mnemonic , expected_xpub , expected_u2f_seed_hex );
241
211
}
242
212
{
243
213
const char * mnemonic_passphrase = "" ;
@@ -247,18 +217,10 @@ static void _test_fixtures(void** state)
247
217
const char * expected_xpub =
248
218
"xpub6DLvpzjKpJ8k4xYrWYPmZQkUe9dkG1eRig2v6Jz4iYgo8hcpHWx87gGoCGDaB2cHFZ3ExUfe1jDiMu7Ch6"
249
219
"gA4ULCBhvwZj29mHCPYSux3YV" ;
250
- const char * expected_pubkey_uncompressed_hex =
251
- "04588110a40455d74a3fd439fa2f4c0994cd0dc64644f9e5bc03cc99e7fcfe32eea56cb72d31cb997663b1"
252
- "f62ad12e9c3a24b717064e8db4cc8ca70ac8a98a46a5" ;
253
220
const char * expected_u2f_seed_hex =
254
221
"20d68b206aff9667b623a460ce61fc94762de67561d6855ca9a6df7b409b2a54" ;
255
222
_test_combination (
256
- mnemonic_passphrase ,
257
- seed_len ,
258
- expected_mnemonic ,
259
- expected_xpub ,
260
- expected_pubkey_uncompressed_hex ,
261
- expected_u2f_seed_hex );
223
+ mnemonic_passphrase , seed_len , expected_mnemonic , expected_xpub , expected_u2f_seed_hex );
262
224
}
263
225
}
264
226
0 commit comments