mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
nem: Fix NEM_ENCRYPTED_SIZE
Include the extra padding block for multiples of AES_BLOCK_SIZE
This commit is contained in:
parent
d41556d7fc
commit
44480ca15d
2
nem.h
2
nem.h
@ -52,7 +52,7 @@
|
||||
|
||||
#define NEM_SALT_SIZE sizeof(ed25519_public_key)
|
||||
|
||||
#define NEM_ENCRYPTED_SIZE(size) (((size) + AES_BLOCK_SIZE - 1) / AES_BLOCK_SIZE * AES_BLOCK_SIZE)
|
||||
#define NEM_ENCRYPTED_SIZE(size) (((size) + AES_BLOCK_SIZE) / AES_BLOCK_SIZE * AES_BLOCK_SIZE)
|
||||
#define NEM_ENCRYPTED_PAYLOAD_SIZE(size) (AES_BLOCK_SIZE + NEM_SALT_SIZE + NEM_ENCRYPTED_SIZE(size))
|
||||
|
||||
#define NEM_DECRYPTED_SIZE(buffer, size) ((size) - ((buffer)[(size) - 1]))
|
||||
|
Loading…
Reference in New Issue
Block a user