Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aes.c aes_setkey_enc() generates too many round keys #183

Closed
jakcron opened this issue Mar 21, 2015 · 2 comments
Closed

aes.c aes_setkey_enc() generates too many round keys #183

jakcron opened this issue Mar 21, 2015 · 2 comments

Comments

@jakcron
Copy link

jakcron commented Mar 21, 2015

The total number of round keys for 128, 192 and 256 bit keys are 44, 52 and 60 respectively. However aes_setkey_enc() creates, 44, 54 and 64 respectively.

This doesn't cause any errors because as far as I can see it's intentional, since aes_context can hold 8 more round keys than it should, preventing an overflow.

Is it really worth it to not implement better logic? All that's needed are:
1/ "if( i+1 == 8 ) break;" after https://github.com/ARMmbed/mbedtls/blob/development/library/aes.c#L557
2/ "if( i+1 == 7 ) break;" after https://github.com/ARMmbed/mbedtls/blob/development/library/aes.c#L575

@mpg
Copy link
Contributor

mpg commented Mar 24, 2015

Actually a bit more that that is needed, see aesni.c and padlock.c.

@mpg
Copy link
Contributor

mpg commented Jul 23, 2015

Closing as I think the current size in aes_context makes it easier on alternative implementations, and since there is room, why not use it ourselves?

Please feel free to re-open and try to convince me if you disagree.

@mpg mpg closed this as completed Jul 23, 2015
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Sep 3, 2019
…-register_key

Secure element key registration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants