diff --git a/Makefile b/Makefile index 4319e07..e067189 100755 --- a/Makefile +++ b/Makefile @@ -47,8 +47,7 @@ APP_LOAD_PARAMS += --path "2645'/579218131'" DEFINES += HAVE_STARKWARE DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3 # Allow to derive ETH 2 public keys -# TODO : add curve reference on latest firmware -APP_LOAD_PARAMS += --path "12381/3600" +APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1 DEFINES += HAVE_ETH2 APPNAME = "Ethereum" DEFINES_LIB= @@ -63,8 +62,7 @@ DEFINES += HAVE_STARKWARE DEFINES += HAVE_TOKENS_EXTRA_LIST DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3 # Allow to derive ETH 2 public keys -# TODO : add curve reference on latest firmware -APP_LOAD_PARAMS += --path "12381/3600" +APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1 DEFINES += HAVE_ETH2 APPNAME = "Eth Ropsten" DEFINES_LIB= diff --git a/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c b/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c index 08e50af..34696b0 100644 --- a/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c +++ b/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c @@ -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) {