20250103-Sha512Final-no-scratch-digest #8329
Open
+6
−16
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.
wolfcrypt/src/sha512.c
: inSha512FinalRaw()
andwc_Sha384FinalRaw()
, refactor out the scratch digest --ByteReverseWords64()
is safe in-place, and the scratch digest caused aSEGV
in theXMEMCPY()
on AVX512-capable targets built withgcc -march=native -O2
unlessXALIGN(64)
, due togcc
bug(s).Note, the bug only manifests in ASAN builds, repro'd on gcc-13, gcc-14, and gcc-15. Regular
-O2
build passesunit.test
without this patch.tested with
wolfssl-multi-test.sh check-source-text sp-all-asm-sanitizer
on an AVX512 target.