mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 16:51:08 +00:00
Adjust AES RAM usage according to config options
Do not reserve additionl 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. In baremetal configuration reserve space for 10 128-bit keys in order to save 112 bytes of heap.
This commit is contained in:
parent
5bdafa21e0
commit
5ed870da72
|
@ -87,6 +87,9 @@ typedef struct mbedtls_aes_context
|
|||
{
|
||||
int nr; /*!< The number of rounds. */
|
||||
uint32_t *rk; /*!< AES round keys. */
|
||||
#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && !defined(MBEDTLS_PADLOCK_C)
|
||||
uint32_t buf[44]; /*!< Unaligned data buffer */
|
||||
#else /* MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */
|
||||
uint32_t buf[68]; /*!< Unaligned data buffer. This buffer can
|
||||
hold 32 extra Bytes, which can be used for
|
||||
one of the following purposes:
|
||||
|
@ -95,6 +98,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_aes_context;
|
||||
|
||||
|
|
Loading…
Reference in a new issue