mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-09 08:31:33 +08:00
AES: adjust AES RAM usage according to config options
Do not reserve additional space for mbedtls_aes_context if config option AES_ONLY_128_BIT_KEY_LENGTH is used and PADLOCK_C is not used. This reduces RAM usage by 96 bytes. Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
0f06618db0
commit
b1c626b5c6
@ -76,6 +76,9 @@ typedef struct mbedtls_aes_context {
|
||||
int MBEDTLS_PRIVATE(nr); /*!< The number of rounds. */
|
||||
size_t MBEDTLS_PRIVATE(rk_offset); /*!< The offset in array elements to AES
|
||||
round keys in the buffer. */
|
||||
#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && !defined(MBEDTLS_PADLOCK_C)
|
||||
uint32_t MBEDTLS_PRIVATE(buf)[44];
|
||||
#else
|
||||
uint32_t MBEDTLS_PRIVATE(buf)[68]; /*!< Unaligned data buffer. This buffer can
|
||||
hold 32 extra Bytes, which can be used for
|
||||
one of the following purposes:
|
||||
@ -84,6 +87,7 @@ typedef struct mbedtls_aes_context {
|
||||
<li>Simplifying key expansion in the 256-bit
|
||||
case by generating an extra round key.
|
||||
</li></ul> */
|
||||
#endif /* MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH && !MBEDTLS_PADLOCK_C */
|
||||
}
|
||||
mbedtls_aes_context;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user