Update SHA proof for "moving AArch64/X86_64 dispatching to C" changes #155
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
AWS-LC PR: aws/aws-lc#1625
Ticket: V1417594860
The AWS-LC PR refactors existing SHA2 code to move AArch86/x86_64 dispatching code from within the assembly to within the C. In doing so, assembly function names are changed in the following way:
sha512_block_data_order
routine is now calledsha512_block_data_order_avx
sha512_block_data_order
routine is now calledsha512_block_data_order_nohw
(for Graviton2) andsha512_block_armv8
routine is now calledsha512_block_data_order_hw
(for Graviton3)While working on the fix, I solved a problem in the proof of
EVP_DigestFinal
. Previously, the proof fails for SHA512 because the LLVM optimization introduces pointer comparisons, which is an undefined behaviour in SAW (see GaloisInc/saw-script#1308). SAW produces the error:"Comparison of pointers from different allocations"
In this fix, we use SAW feature
enable_lax_pointer_ordering
to allow pointer comparison introduced by LLVM optimization. In addition, this proof requires defining an override forCRYPTO_bswap8
for the version that uses__builtin_bswap64
: