Repository navigation
sp: do not rely on an 8-bit char when recoding the scalar - #11889
Merged
Merged
Conversation
|
retest this please |
|
Contributor
|
looks good. tests good with multi-test sp sanitizer and related. |
philljj
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The windowed SP ECC scalar recode takes the low octet with
y = (word8)(int8_t)n, which only truncates wherecharis 8 bits; on aCHAR_BIT == 16targetint8_tdoes not exist and the build fails outright, leavingWOLFSSL_SP_SMALLas the only usable path. Replaced withy = (word8)(n & 0xff)across the eight generated backends, matching the generator fix in wolfSSL/scripts#702; the files are edited in place rather than regenerated, since a regen would also pull in unrelated generator work not yet reflected here. Verified withmake checkunder--enable-all --enable-sp --enable-sp-asm, and on a TI LAUNCHXL-F28P55X where ECDSA and ECDH over P-256 and P-384 now pass on hardware. On arm32, armthumb, cortexm and riscv64 the routine sits behindWOLFSSL_SP_NONBLOCK, so those four were checked with per-architecture cross-compiles rather than by CI.