kokke/tiny-AES-c

Function for trading ROM for RAM

skater-boy opened this issue · 4 comments

Hi all!

In aes.c I can read "The numbers below can be computed dynamically trading ROM for RAM".
This comment is about "static const uint8_t sbox[256]" and "static const uint8_t rsbox[256]".
I need to save some ROM while I have lot of free ram.

Have I to implement a function based on information from https://en.wikipedia.org/wiki/Rijndael_S-box?

kokke commented

The function shown in the wikipedia article does the trick: https://en.wikipedia.org/wiki/Rijndael_S-box#Example_implementation_in_C_language

That function will calculate the s-box dynamically :)

I given a try to the function AES_generateSBox() from the link posted on October, 27 and it works. The s-box is placed in RAM and filled at runtime, dynamically.
Yes, also the initialize_aes_sbox() from the wikipedia link calculate the s-box dynamically.
Or maybe I didn't understand what you meant?

kokke commented

I given a try to the function AES_generateSBox() from the link posted on October, 27 and it works. The s-box is placed in RAM and filled at runtime, dynamically.

Ah, you are referring to the answer by @Andrew -> https://electronics.stackexchange.com/a/32633/9775

If I click your link, it goes to https://github.com/kokke/tiny-AES-c/issues/url even though the link-text is for electronics.stackexchange - so that confused me I guess :)

Yes, also the initialize_aes_sbox() from the wikipedia link calculate the s-box dynamically.
Or maybe I didn't understand what you meant?

Haha total confusion :D yes that is exactly what I meant. I just hadn't seen you'd found an answer already :)