-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
SHA-3 update #7714
SHA-3 update #7714
Conversation
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
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.
Thanks, just one more thing about the MD_CAN
macro(s).
Btw, ideally, test cases in test_suite_md
should be using the appropriate MD_CAN
macro as well, rather than SHA3_C
, but right now the dependency is correct, and we can update it when we add PSA driver support for SHA-3.
(Note: in test_suite_shax
however, the correct dependency is indeed SHA3_C
and will remain so even when we add PSA driver support.)
@@ -113,7 +113,10 @@ | |||
#define MBEDTLS_MD_SOME_LEGACY | |||
#endif | |||
#if defined(MBEDTLS_SHA3_C) | |||
#define MBEDTLS_MD_CAN_SHA3 | |||
#define MBEDTLS_MD_CAN_SHA3_224 |
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.
Thanks, but I think we also need to update the declared dependencies in tests, namely in tests/suites/test_suite_hmac_drbg.misc.data
, otherwise those cases are going to be skipped in all builds.
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.
Signed-off-by: Dave Rodgman <[email protected]>
include/mbedtls/md.h
Outdated
* buffer size using MD_MAX_SIZE in a part of the code that's common to PSA | ||
* and legacy, then assume the buffer's size is PSA_HASH_MAX_SIZE in another | ||
* part of the code based on PSA. | ||
*/ | ||
#if defined(MBEDTLS_MD_CAN_SHA512) || defined(MBEDTLS_SHA3_C) |
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.
MBEDTLS_SHA3_C
should be MBEDTLS_MD_CAN_SHA3_512
, and there should be separate checks for the other MBEDTLS_MD_CAN_SHA3_xxx
s
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
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.
LGTM
Signed-off-by: Dave Rodgman <[email protected]>
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.
LGTM
Sorry, but I think there's enough in here that it's not |
@mpg or @gilles-peskine-arm are either of you two planning to review this? |
Yes, I've been reviewing, fully intent on re-reviewing. |
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.
LGTM, thanks!
Description
Address a few issues in SHA-3 identified in #7708 . Fixes #7713
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")