Merge :gerard: review feedbacks

This commit is contained in:
BTChip github
2020-11-25 10:04:36 +01:00
committed by TamtamHero
parent d43f7f6698
commit 7f0bad329b
3 changed files with 3 additions and 5 deletions

View File

@@ -322,7 +322,7 @@ This command has been supported since firmware version 1.5.0
This command returns an Ethereum 2 BLS12-381 public key derived following EIP 2333 specification (https://eips.ethereum.org/EIPS/eip-2333)
This command has been supported since firmware version 1.5.0
This command has been supported since firmware version 1.6.0
#### Coding

View File

@@ -22,8 +22,8 @@ void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out
memmove(tmp + 16, privateKeyData, 32);
cx_ecfp_init_private_key(CX_CURVE_BLS12_381_G1, tmp, 48, &privateKey);
cx_ecfp_generate_pair(CX_CURVE_BLS12_381_G1, &publicKey, &privateKey, 1);
memset(tmp, 0, 96);
memset((void*)&privateKey, 0, sizeof(cx_ecfp_256_extended_private_key_t));
explicit_bzero(tmp, 96);
explicit_bzero((void*)&privateKey, sizeof(cx_ecfp_256_extended_private_key_t));
tmp[47] = 2;
cx_math_mult(tmp, publicKey.W + 1 + 48, tmp, 48);
if (cx_math_cmp(tmp + 48, BLS12_381_FIELD_MODULUS, 48) > 0) {

View File

@@ -5,8 +5,6 @@
void handleSetEth2WithdrawalIndex(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
UNUSED(dataLength);
if (dataLength != 4) {
THROW(0x6700);
}