diff --git a/src_common/ethUstream.c b/src_common/ethUstream.c index 09e5de6..ddcba8f 100644 --- a/src_common/ethUstream.c +++ b/src_common/ethUstream.c @@ -48,7 +48,7 @@ uint8_t readTxByte(txContext_t *context) { context->currentFieldPos++; } if (!(context->processingField && context->fieldSingleByte)) { - cx_hash((cx_hash_t*)context->sha3, 0, &data, 1, NULL); + cx_hash((cx_hash_t*)context->sha3, 0, &data, 1, NULL, 0); } return data; } @@ -62,7 +62,7 @@ void copyTxData(txContext_t *context, uint8_t *out, uint32_t length) { os_memmove(out, context->workBuffer, length); } if (!(context->processingField && context->fieldSingleByte)) { - cx_hash((cx_hash_t*)context->sha3, 0, context->workBuffer, length, NULL); + cx_hash((cx_hash_t*)context->sha3, 0, context->workBuffer, length, NULL, 0); } context->workBuffer += length; context->commandLength -= length; diff --git a/src_common/ethUtils.c b/src_common/ethUtils.c index 438daf9..3eedb6e 100644 --- a/src_common/ethUtils.c +++ b/src_common/ethUtils.c @@ -124,7 +124,7 @@ void getEthAddressFromKey(cx_ecfp_public_key_t *publicKey, uint8_t *out, cx_sha3_t *sha3Context) { uint8_t hashAddress[32]; cx_keccak_init(sha3Context, 256); - cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress); + cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress, 32); os_memmove(out, hashAddress + 12, 20); } @@ -159,7 +159,7 @@ void getEthAddressStringFromKey(cx_ecfp_public_key_t *publicKey, uint8_t *out, cx_sha3_t *sha3Context) { uint8_t hashAddress[32]; cx_keccak_init(sha3Context, 256); - cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress); + cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress, 32); getEthAddressStringFromBinary(hashAddress + 12, out, sha3Context); } @@ -168,7 +168,7 @@ void getEthAddressStringFromBinary(uint8_t *address, uint8_t *out, uint8_t hashChecksum[32]; uint8_t i; cx_keccak_init(sha3Context, 256); - cx_hash((cx_hash_t*)sha3Context, CX_LAST, address, 20, hashChecksum); + cx_hash((cx_hash_t*)sha3Context, CX_LAST, address, 20, hashChecksum, 32); for (i = 0; i < 40; i++) { out[i] = convertDigit(address, i, hashChecksum); } @@ -183,7 +183,7 @@ void getEthAddressStringFromKey(cx_ecfp_public_key_t *publicKey, uint8_t *out, cx_sha3_t *sha3Context) { uint8_t hashAddress[32]; cx_keccak_init(sha3Context, 256); - cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress); + cx_hash((cx_hash_t*)sha3Context, CX_LAST, publicKey->W + 1, 64, hashAddress, 32); getEthAddressStringFromBinary(hashAddress + 12, out, sha3Context); } @@ -210,7 +210,7 @@ void getEthAddressStringFromBinary(uint8_t *address, uint8_t *out, tmp[offset + 2 * i + 1] = HEXDIGITS[digit & 0x0f]; } cx_keccak_init(sha3Context, 256); - cx_hash((cx_hash_t*)sha3Context, CX_LAST, tmp, offset + 40, hashChecksum); + cx_hash((cx_hash_t*)sha3Context, CX_LAST, tmp, offset + 40, hashChecksum, 32); for (i = 0; i < 40; i++) { uint8_t digit = address[i / 2]; if ((i % 2) == 0) {