Reenable feature, add curve to path checking mechanism

This commit is contained in:
BTChip github
2020-10-30 21:47:30 +01:00
committed by TamtamHero
parent 7e53de8897
commit da43b51fbc
2 changed files with 3 additions and 7 deletions

View File

@@ -9,7 +9,6 @@
static const uint8_t BLS12_381_FIELD_MODULUS[] = { 0x1a, 0x01, 0x11, 0xea, 0x39, 0x7f, 0xe6, 0x9a, 0x4b, 0x1b, 0xa7, 0xb6, 0x43, 0x4b, 0xac, 0xd7, 0x64, 0x77, 0x4b, 0x84, 0xf3, 0x85, 0x12, 0xbf, 0x67, 0x30, 0xd2, 0xa0, 0xf6, 0xb0, 0xf6, 0x24, 0x1e, 0xab, 0xff, 0xfe, 0xb1, 0x53, 0xff, 0xff, 0xb9, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xaa, 0xab };
void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out) {
#if 0
uint8_t privateKeyData[32];
cx_ecfp_256_extended_private_key_t privateKey;
cx_ecfp_384_public_key_t publicKey;
@@ -17,7 +16,7 @@ void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out
uint8_t tmp[96];
io_seproxyhal_io_heartbeat();
os_perso_derive_eip2333(bip32Path, bip32PathLength, privateKeyData);
os_perso_derive_eip2333(CX_CURVE_BLS12_381_G1, bip32Path, bip32PathLength, privateKeyData);
io_seproxyhal_io_heartbeat();
memset(tmp, 0, 48);
memmove(tmp + 16, privateKeyData, 32);
@@ -33,7 +32,6 @@ void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out
publicKey.W[1] &= 0x1f;
publicKey.W[1] |= 0x80 | yFlag;
memmove(out, publicKey.W + 1, 48);
#endif
}
void handleGetEth2PublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {