summaryrefslogtreecommitdiffstats
path: root/cmd/aes.c
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2020-01-06 15:22:34 +0100
committerTom Rini <trini@konsulko.com>2020-01-17 10:15:49 -0500
commit7012c04ef3dea6ab05cab74879e1ab97c7a086e2 (patch)
treedb64b7e0029c5a6d4cc700808ab0bc3f77471ee7 /cmd/aes.c
parentd7bb6aceb2e99a832efbb96f9bf480bf95602192 (diff)
downloadu-boot-7012c04ef3dea6ab05cab74879e1ab97c7a086e2.tar.gz
u-boot-7012c04ef3dea6ab05cab74879e1ab97c7a086e2.tar.xz
u-boot-7012c04ef3dea6ab05cab74879e1ab97c7a086e2.zip
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>
Diffstat (limited to 'cmd/aes.c')
-rw-r--r--cmd/aes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/aes.c b/cmd/aes.c
index 8c61cee8e8..24b0256a76 100644
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -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,