Closed Alonof closed 5 years ago
@alonof wouldn't this be better integrated in Mbed Cloud Client upstream? Happy to land it here, but the rest of Cloud Client would benefit from this too.
@janjongboom Hi, I see no reason why everybody cant enjoy this, Maybe we should ask mbedtls team why they didnt enable this flag
@Alonof - you remember where these configs are? The root of these are coming via the mbed-client-pal repo, so we should put these there...
Though, looking at this line.. https://github.com/ARMmbed/mbed-client-pal/blob/master/Configs/mbedTLS/mbedTLSConfig_mbedOS_SW_TRNG.h#L213
It's a trade-off of some sorts, how does this flag interact with that other one? RAM is typically MORE precious than ROM.
@JanneKiiskila - MBEDTLS_AES_FEWER_TABLES does not replace MBEDTLS_AES_ROMTABLES it is an addon to reduce the code size, instead of declaring 8 ROM tables the addon flag reduces them to 2 ROM tables. *(you can use MBEDTLS_AES_FEWER_TABLES without declaring MBEDTLS_AES_ROMTABLES)
MBEDTLS_AES_ROM_TABLES flag generates ALL of the tables on the ROM
For additional information please read (pros & cons): https://github.com/ARMmbed/mbedtls/blob/aa9f3fd6b143d86294e2626e8a91fd9ebbd87348/include/mbedtls/config.h#L473
This is now in Mbed Cloud Client (https://github.com/ARMmbed/mbed-client-pal/blob/master/Configs/mbedTLS/mbedTLSConfig_mbedOS_SW_TRNG.h#L87).
MBEDTLS_AES_FEWER_TABLES, to dynamically compute smaller AES tables during runtime, thereby reducing the RAM/ROM footprint by ~6KiB. this causes speed reduction here is the following benchmark tests:
there is a small redcution in speed by 2-5% *tested on K64F
For additional information please read (pros & cons): https://github.com/ARMmbed/mbedtls/blob/aa9f3fd6b143d86294e2626e8a91fd9ebbd87348/include/mbedtls/config.h#L473
https://github.com/ARMmbed/mbedtls/blob/aa9f3fd6b143d86294e2626e8a91fd9ebbd87348/include/mbedtls/config.h#L490