summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2020-01-06 17:22:34 +0300
committerTom Rini <trini@konsulko.com>2020-01-17 18:15:49 +0300
commit7012c04ef3dea6ab05cab74879e1ab97c7a086e2 (patch)
treedb64b7e0029c5a6d4cc700808ab0bc3f77471ee7 /include
parentd7bb6aceb2e99a832efbb96f9bf480bf95602192 (diff)
downloadu-boot-7012c04ef3dea6ab05cab74879e1ab97c7a086e2.tar.xz
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 'include')
-rw-r--r--include/uboot_aes.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/uboot_aes.h b/include/uboot_aes.h
index 2fda384e3b..1ae3ac9cb2 100644
--- a/include/uboot_aes.h
+++ b/include/uboot_aes.h
@@ -18,7 +18,7 @@ typedef unsigned int u32;
* AES encryption library, with small code size, supporting only 128-bit AES
*
* AES is a stream cipher which works a block at a time, with each block
- * in this case being AES_KEY_LENGTH bytes.
+ * in this case being AES_BLOCK_LENGTH bytes.
*/
enum {
@@ -28,6 +28,7 @@ enum {
AES_KEY_LENGTH = 128 / 8,
AES_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES_ROUNDS + 1),
+ AES_BLOCK_LENGTH = 128 / 8,
};
/**
@@ -62,7 +63,7 @@ void aes_decrypt(u8 *in, u8 *expkey, u8 *out);
/**
* Apply chain data to the destination using EOR
*
- * Each array is of length AES_KEY_LENGTH.
+ * Each array is of length AES_BLOCK_LENGTH.
*
* @cbc_chain_data Chain data
* @src Source data