New wolfcrypt Hardware Acceleration SHA Copy Tests #6134
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As noted in #5989, there are some wolfcrypt tests that are missing. These are tests that in a software-only solution, would likely be not very interesting. However - given the common single current use of hardware acceleration, these new tests ensure the hardware state of a given SHA
ctx
is properly handled when copied. In particular, if thectx
is copied, and then processed, does it interfere with current hardware calculations in progress? It should not.Note making the attached change will result in failure the ESP32 tests to fail unless
#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH
is defined, turning off HW and using only wolfcrypt software.My next version of the hardware acceleration in my ED25519_SHA2_fix branch has a much more robust implementation that handles the copy gracefully. I prefer to have the tests in place prior to that PR to better illustrate before & after results.
I'd like to get some feedback before I go and implement this for all of the tests. For now this is a draft PR.
There's a slight chance that other hardware acceleration implementations might fail.
See also #5948
Fixes zd# n/a
Testing
Use wolfcrypt/test for both software-only, and hardware-accelerated SHA calculations.
Checklist