Skip to content

ARM32/Thumb2 ASM SHA-256: provide small code size option#9491

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:sha256_armasm_small
Dec 4, 2025
Merged

ARM32/Thumb2 ASM SHA-256: provide small code size option#9491
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:sha256_armasm_small

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

@SparkiDev SparkiDev commented Dec 4, 2025

Description

WOLFSSL_ARMASM_SHA256_SMALL for Thumb2 and ARM32 using base instructions compiles implementations that are smaller but slower.

Fixes zd#20831

Testing

./configure --disable-shared LDFLAGS=--static --host=armv7m CC=arm-linux-gnueabi-gcc --enable-armasm
./configure --disable-shared LDFLAGS=--static --host=armv7m CC=arm-linux-gnueabi-gcc --enable-armasm=sha256-small
../configure --disable-shared LDFLAGS=--static --host=armv7m CC=arm-linux-gnueabi-gcc --enable-armasm=inline
./configure --disable-shared LDFLAGS=--static --host=armv7m CC=arm-linux-gnueabi-gcc --enable-armasm=inline,sha256-small
./configure --disable-shared LDFLAGS=--static --host=armv6 CC=arm-linux-gnueabi-gcc --enable-armasm
./configure --disable-shared LDFLAGS=--static --host=armv6 CC=arm-linux-gnueabi-gcc --enable-armasm=sha256-small
/configure --disable-shared LDFLAGS=--static --host=armv6 CC=arm-linux-gnueabi-gcc --enable-armasm=inline
./configure --disable-shared LDFLAGS=--static --host=armv6 CC=arm-linux-gnueabi-gcc --enable-armasm=inline,sha256-small

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev
Copy link
Copy Markdown
Contributor Author

Code generated from PR:
https://github.com/wolfSSL/scripts/pull/525

WOLFSSL_ARMASM_SHA256_SMALL for Thumb2 and ARM32 using base instructions
compiles implementations that are smaller but slower.
@SparkiDev SparkiDev force-pushed the sha256_armasm_small branch from 5169bce to bff29a8 Compare December 4, 2025 06:44
@SparkiDev
Copy link
Copy Markdown
Contributor Author

retest this please

generic:
wolf-linux-cloud-node-sum9t6 seems to be removed or offline (hudson.remoting.RequestAbortedException: java.io.StreamCorruptedException: invalid stream header: 636F7272); will wait for 5 min 0 sec for it to come back online

Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces SHA256 by 1,472 bytes on Cortex-M. Test results:

STM32L4 - Cortex-M4 at 80MHz
190936	    836	   3656	 195428	  2fb64	STM32L4.elf
SHA-256                    800 KiB took 1.012 seconds,  790.514 KiB/s

WOLFSSL_ARMASM_SHA256_SMALL
189464	    836	   3656	 193956	  2f5a4	STM32L4.elf
SHA-256                    750 KiB took 1.000 seconds,  750.000 KiB/s

@dgarske dgarske merged commit 003f238 into wolfSSL:master Dec 4, 2025
301 of 302 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.

3 participants