-
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
Add SM3 to mbedtls and PSA Crypto #4492
base: development
Are you sure you want to change the base?
Conversation
Hi @th0ma5b - Thankyou for your contribution, this looks very useful. A couple of points, could you sign off your commits (DCO check failed) and possibly add a changelog entry (https://github.com/ARMmbed/mbedtls/blob/development/ChangeLog.d/00README.md) Unfortunately this also already requires rebase, but this could be done before or after review. |
Update:
Can you provide access to error log from CI? (not accessible) |
I put travis CI link in my comment. Please take a look |
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.
Thank you for your contribution! I have done a first round of review, focusing on the project conventions and structure. I have not looked at the cryptographic code at all.
Add psa dispatch code Signed-off-by: Thomas Bourlard <[email protected]>
Signed-off-by: Thomas Bourlard <[email protected]>
Signed-off-by: Thomas Bourlard <[email protected]>
Add SM3 tests to test_suite_psa_crypto_metadata.data Add SM3 tests to test_suite_md.data to test dispatch via mbedtls_md_xxx() Create test_suite_sm3 to test low-level mbedtls_sm3_xxx() Remove SM3 test from test_suite_mdx.data Change SM3 test vectors to lower case in test_suite_psa_crypto_hash.data Signed-off-by: Thomas Bourlard <[email protected]>
Remove unused MBEDTLS_ERR_SM3_HW_ACCEL_FAILED Fix Travis CI error reported by -fsanitize=undefined option Reorder MBEDTLS_XXX_ALT in alphabetical order Add reference to SM3 specification in sm3.h Remove MBEDTLS_INTERNAL_VALIDATE_XXX() parameter checks Fix Travis CI error [PSA] Update SM3 #define flags to fix no driver config: (full config + set MBEDTLS_PSA_CRYPTO_CONFIG + unset MBEDTLS_PSA_CRYPTO_DRIVERS + unset MBEDTLS_USE_PSA_CRYPTO) Add SM3 to tests/scripts/all.sh Remove NULL pointer parameter check test Update comment about number of SM3 error Add missing SM3 case in is_hash_accelerated Extend mbedtls SM3 tests Update tests/scripts/depends-hashes.pl with SM3 Signed-off-by: Thomas Bourlard <[email protected]>
Add SM3 to the "good standing" group of hash algos. Signed-off-by: Thomas Bourlard <[email protected]>
Signed-off-by: Thomas Bourlard <[email protected]>
Signed-off-by: Thomas Bourlard <[email protected]>
Co-authored-by: Jerry Yu <[email protected]> Signed-off-by: Thomas Bourlard <[email protected]>
Signed-off-by: Thomas Bourlard <[email protected]>
This PR will need a rebase and a small additional patch once #5644 is merged, to add the new algorithm to |
Hi, what is the status of this MR? I want to use SM3/SM4 in my private project, what can I do to make this MR merged ASAP? |
@gaoqingshui This pull request is waiting for review. Review bandwidth is the main bottleneck of the Mbed TLS team, and I'm afraid I can't give a date for when we'll be able to. If you're willing, you can help the project by becoming a reviewer! Meaning reading the review guidelines, start reviewing other people's pull requests, and reach the point where you're considered a trusted reviewer and so reduce the workload of other reviewers. |
#if defined(MBEDTLS_PLATFORM_C) | ||
#include "mbedtls/platform.h" | ||
#else | ||
#include <stdio.h> | ||
#define mbedtls_printf printf | ||
#endif /* MBEDTLS_PLATFORM_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.
We've realized that the conditional inclusion of platform.h
on MBEDTLS_PLATFORM_C
was not a good idea, and we're moving to unconditional inclusion. Please use the new style in this new file.
#if defined(MBEDTLS_PLATFORM_C) | |
#include "mbedtls/platform.h" | |
#else | |
#include <stdio.h> | |
#define mbedtls_printf printf | |
#endif /* MBEDTLS_PLATFORM_C */ | |
#include "mbedtls/platform.h" |
Or even include mbedtls/platform.h
regardless of MBEDTLS_SELF_TEST
.
We are now converting older PRs to draft PRs where the following conditions are met: They have not been updated in the last 3 months, and they need more than non-trivial work to complete. I've added "needs-work" since conflicts have now appeared. |
GB/T 32905-2016 compliant SM3 implementation.
The SM3 algorithm was designed by Xiaoyun Wang et al in 2010.
http://www.gmbz.org.cn/upload/2018-07-24/1532401392982079739.pdf
Signed-off-by: Thomas Bourlard [email protected]