Repository navigation
Commit d6a45dd
committed
Make SHA3_SMALL a Zephyr Kconfig option, off by default
The module's user_settings.h defined WOLFSSL_SHA3_SMALL for every build
with ML-KEM, ML-DSA, XMSS or Falcon enabled, FIPS v6 builds included.
The small Keccak permutation runs about 1.5x slower: on STM32H743
(Cortex-M7) and RW612 (Cortex-M33) with the C permutation at -O2, it
made BlockSha3 45-50% slower, ML-KEM-768 25-35% slower and ML-DSA-65
key generation and verification 36-43% slower. It saves about 3 KB of
flash (2.8 KB at -Os) and 170 bytes of stack.
Add CONFIG_WOLFSSL_SHA3_SMALL, default n, so PQC builds get the fast
permutation and size-constrained targets can still opt in. The option
is only offered where the C permutation is built: the Arm assembly
BlockSha3 ignores WOLFSSL_SHA3_SMALL, FIPS v7 and FIPS Ready take their
SHA-3 settings from user_settings-fips-v7.h, and FIPS v2 and v5 never
defined it. Builds that supply their own settings file are unaffected.
PQC builds without the Arm assembly grow by about 3 KB of flash and 170
bytes of stack unless they enable the option. Under FIPS v6 the
compiled sha3.c changes, so the module has to be rehashed as after any
other configuration change.1 parent 8ae4ab5 commit d6a45dd
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
326 | 336 | | |
327 | 337 | | |
328 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
649 | 652 | | |
650 | 653 | | |
651 | | - | |
| 654 | + | |
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
655 | 658 | | |
656 | 659 | | |
657 | | - | |
658 | 660 | | |
659 | 661 | | |
660 | 662 | | |
| |||
0 commit comments