-
Notifications
You must be signed in to change notification settings - Fork 833
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
Feature/multiple aes siv ads #7911
Feature/multiple aes siv ads #7911
Conversation
…s given in RFC5297.
Can one of the admins verify this patch? |
Okay to test. Contributor agreement in progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over to @wolfSSL-Bot and @SparkiDev for further review. Thank you for adding a test case.
wolfcrypt/src/aes.c
Outdated
keySz); | ||
/* Loop over authenticated associated data AD1..ADn */ | ||
byte tmpi = 0; | ||
for(word32 ai = 0; ai < numAssoc; ++ai) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For portability please declare word32 ai
on line above. Code consistency please use for (
add space.
wolfcrypt/src/aes.c
Outdated
@@ -13826,7 +13843,8 @@ int wc_AesSivEncrypt(const byte* key, word32 keySz, const byte* assoc, | |||
word32 assocSz, const byte* nonce, word32 nonceSz, | |||
const byte* in, word32 inSz, byte* siv, byte* out) | |||
{ | |||
return AesSivCipher(key, keySz, assoc, assocSz, nonce, nonceSz, in, inSz, | |||
const AesSivAssoc ad0 = { .assoc = assoc, .assocSz=assocSz }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This syntax is not very portable. Please use:
AesSivAssoc ad0;
ad0.assoc = assoc;
ad0.assocSz = assocSz;
Okay to test. Contributor agreement in progress. @ptsiewie sorry for the delay in getting your agreement approved. Expect it next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature looks good to me. @SparkiDev please review. Also should we wrap any of this new SIV support in a new build macro?
The old API goes through the new API so we will always include code. |
Hi @ptsiewie Errors in ctidy check TLDR: change '1u' to '1U' Error: |
…ense, especially since in the RFC 5297 document they're actually counting the ADs from 1.
Okay to test. Retest this please |
Reminder, contributor agreement in progress, but not yet approved. Person needed for that is on vacation this week. |
Contributor agreement approved and on file. Thank you @ptsiewie! |
Do I need to do something before this branch will be merged? |
Hi @ptsiewie , Thank you for your work on this. I have merged it. Sorry about the delay. Thanks, |
Description
The AES SIV algorithm implementation in WolfSSL would accept only exactly one vector of associated data, even though the definition of the algorithm of RFC5297 allows any number no larger than 126.
Fixes zd#18509
Testing
The tests in test.c have been extended to include the two examples given in the RFC5297 document. The second of these two examples uses two ADs.
Checklist