From 7b1b9d306961db7bb6a2873f57a93a9d47d13aae Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Wed, 4 Apr 2018 11:21:37 +0200 Subject: [PATCH] nem: IV is not copied The IV copy was moved to trezor-crypto (https://github.com/trezor/trezor-crypto/pull/140) so it is not needed in trezor-mcu anymore --- firmware/nem2.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/firmware/nem2.c b/firmware/nem2.c index d26f9cc2c8..216791a56f 100644 --- a/firmware/nem2.c +++ b/firmware/nem2.c @@ -264,11 +264,8 @@ bool nem_fsmTransfer(nem_transaction_ctx *context, const HDNode *node, const NEM random_buffer(encrypted, NEM_SALT_SIZE + AES_BLOCK_SIZE); - // hdnode_nem_encrypt mutates the IV - uint8_t iv[AES_BLOCK_SIZE]; - memcpy(iv, &encrypted[NEM_SALT_SIZE], AES_BLOCK_SIZE); - const uint8_t *salt = encrypted; + const uint8_t *iv = &encrypted[NEM_SALT_SIZE]; uint8_t *buffer = &encrypted[NEM_SALT_SIZE + AES_BLOCK_SIZE]; bool ret = hdnode_nem_encrypt(node,