1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

bip32, options: optionally exclude 25519 curves in BIP32 support

This commit is contained in:
Peter D. Gray 2018-04-03 12:32:48 -04:00 committed by Pavol Rusnak
parent 877998fa1a
commit b0af159096
2 changed files with 11 additions and 0 deletions

View File

@ -421,6 +421,8 @@ void hdnode_fill_public_key(HDNode *node)
{
if (node->public_key[0] != 0)
return;
#if USE_BIP32_25519_CURVES
if (node->curve->params) {
ecdsa_get_public_key33(node->curve->params, node->private_key, node->public_key);
} else {
@ -437,6 +439,10 @@ void hdnode_fill_public_key(HDNode *node)
curve25519_scalarmult_basepoint(node->public_key + 1, node->private_key);
}
}
#else
ecdsa_get_public_key33(node->curve->params, node->private_key, node->public_key);
#endif
}
#if USE_ETHEREUM

View File

@ -50,6 +50,11 @@
#define BIP32_CACHE_MAXDEPTH 8
#endif
// support constructing BIP32 nodes from ed25519 and curve25519 curves.
#ifndef USE_BIP32_25519_CURVES
#define USE_BIP32_25519_CURVES 1
#endif
// implement BIP39 caching
#ifndef USE_BIP39_CACHE
#define USE_BIP39_CACHE 1