honor Espressif fp_int used length in s_fp_add operands #6382
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
This PR partly addresses #6380. The TFM s_fp_add() is modified to only add
fp_int
words up toused
length in each respective operand, rather than add all words to the maximumused
length between the two operands.TBD if the
fp_cmp
code will be revised.Note this was problematic only with the introduction of Espressif hardware acceleration into a known, good TFM software library.
Fixes zd# n/a
Testing
I confirmed I was able to successfully sign a certificate request using OpenSSL. See #6205
fp_cmp
andfp_int
values of1
with mismatchedused
values in the comparison. See HW fix.Also tested with
testwolfcrypt
:testwolfcrypt
output:Checklist