mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
aes: add a define for the size of a block
In the code, we use the size of the key for the size of the block. It's true when the key is 128 bits, but it become false for key of 192 bits and 256 bits. So to prepare the support of aes192 and 256, we introduce a constant for the iaes block size. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Tom Rini
parent
d7bb6aceb2
commit
7012c04ef3
@@ -56,7 +56,7 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||
aes_expand_key(key_ptr, key_exp);
|
||||
|
||||
/* Calculate the number of AES blocks to encrypt. */
|
||||
aes_blocks = DIV_ROUND_UP(len, AES_KEY_LENGTH);
|
||||
aes_blocks = DIV_ROUND_UP(len, AES_BLOCK_LENGTH);
|
||||
|
||||
if (enc)
|
||||
aes_cbc_encrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr,
|
||||
|
Reference in New Issue
Block a user