Skip to content

sp: do not rely on an 8-bit char when recoding the scalar - #11889

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
dgarske:sp_wide_byte_recode
Oct 28, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
dgarske:sp_wide_byte_recode

Conversation

@dgarske

@dgarske dgarske commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

The windowed SP ECC scalar recode takes the low octet with y = (word8)(int8_t)n, which only truncates where char is 8 bits; on a CHAR_BIT == 16 target int8_t does not exist and the build fails outright, leaving WOLFSSL_SP_SMALL as the only usable path. Replaced with y = (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 with make check under --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 behind WOLFSSL_SP_NONBLOCK, so those four were checked with per-architecture cross-compiles rather than by CI.

@github-actions

Copy link
Copy Markdown

retest this please

@dgarske dgarske assigned wolfSSL-Bot and SparkiDev and unassigned dgarske Oct 26, 2026
@dgarske
dgarske requested a review from SparkiDev October 26, 2026 15:36
@philljj philljj self-assigned this Oct 27, 2026
@philljj

philljj commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

looks good.

tests good with multi-test sp sanitizer and related.

@philljj
philljj merged commit 1c5d943 into wolfSSL:master Oct 28, 2026
607 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants