-
Notifications
You must be signed in to change notification settings - Fork 96
Implement psa_hash_compute and psa_hash_compare #327
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
Conversation
362f8d8
to
375142c
Compare
CI passed except for expected failures (inherited from #325): an ABI change (two external symbols have been renamed) and generated files in TLS (due to the new header). |
375142c
to
6d949ec
Compare
CI succeeded except for |
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.
I'm happy with what I see, except a few notes and questions.
I'm a bit more concerned about what I don't see: do we have an all.sh
component that builds without MD_C
an runs the test suite that way? I'm not seeing one but perhaps I missed something. I'm not very comfortable approving the massing changes in test dependencies on MD_C
without an automated test that confirms the new dependencies are correct.
Also, a conflict has developed and needs to be resolved. |
6d949ec
to
de3f24e
Compare
I rebased to avoid the merge conflict. I kept the same history except for the missing blank line between two test cases. The previous version is in https://github.com/gilles-peskine-arm/mbed-crypto/tree/psa-hash_compute-3 |
We don't run any tests without |
6815077
to
fc85c17
Compare
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 for making the requested changes and fixing the conflict. I'm mostly happy now, except for a naming issue that I failed to notice the first time round.
fc85c17
to
a31c20a
Compare
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 for fixing the naming issue. I'm happy with the result.
@gilles-peskine-arm Just to notify you that #179 was just merged, so this will need a few |
The PSA implementation of hash algorithms, HMAC algorithms and KDF algorithms using HMAC no longer use the MD module.
The PSA implementations of deterministic ECDSA, of all RSA signatures and of RSA OAEP use the MD module.
Whether a parameter should be const is an implementation detail of the function, so don't declare a parameter of psa_hash_compare as const. (This only applies to parameters themselves, not to objects that pointer parameters points to.)
psa_hash_compare is tested for good cases and invalid-signature cases in hash_compute_compare. Also test invalid-argument cases. Also run a few autonomous test cases with valid arguments.
a31c20a
to
88e0846
Compare
Rebased again (previous iteration in https://github.com/gilles-peskine-arm/mbed-crypto/tree/psa-hash_compute-5):
|
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.
It looks good to me in general, I just have two questions.
CI passes except for Mbed OS jobs which is a known preexisting issue. |
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.
An earlier commit fixed this for psa_hash_compare. psa_mac_verify had the same flaw.
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.
After the latest commit, the CI is still passing except for Mbed OS tests which are a known issue independent from this PR. |
Previously in d875285: * ARMmbed#333: Streamline PSA key type encodings: prepare * ARMmbed#323: Initialise return values to an error Previously in dbcb442: * ARMmbed#291: Test MBEDTLS_CTR_DRBG_USE_128_BIT_KEY * ARMmbed#334: Fix some pylint warnings Previously in ceceedb: * ARMmbed#348: Bump version to Mbed TLS 2.20.0 and crypto SO version to 4 * ARMmbed#354: Fix incrementing pointer instead of value In this commit: * ARMmbed#349: Fix minor defects found by Coverity * ARMmbed#179: Add option to build SHA-512 without SHA-384 * ARMmbed#327: Implement psa_hash_compute and psa_hash_compare * ARMmbed#330: Streamline PSA key type and curve encodings
A step on the way to IOTCRYPT-933
If #179 is merged first, this PR will need to be modified to add test case dependencies on
!MBEDTLS_SHA512_NO_SHA384
.