mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-06-20 19:07:59 +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. */
|
int nr; /*!< The number of rounds. */
|
||||||
uint32_t *rk; /*!< AES round keys. */
|
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
|
uint32_t buf[68]; /*!< Unaligned data buffer. This buffer can
|
||||||
hold 32 extra Bytes, which can be used for
|
hold 32 extra Bytes, which can be used for
|
||||||
one of the following purposes:
|
one of the following purposes:
|
||||||
|
@ -95,6 +98,7 @@ typedef struct mbedtls_aes_context
|
||||||
<li>Simplifying key expansion in the 256-bit
|
<li>Simplifying key expansion in the 256-bit
|
||||||
case by generating an extra round key.
|
case by generating an extra round key.
|
||||||
</li></ul> */
|
</li></ul> */
|
||||||
|
#endif /* MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */
|
||||||
}
|
}
|
||||||
mbedtls_aes_context;
|
mbedtls_aes_context;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue