Skip to content

SP: --enable-sp-asm now enables SP if not set#5851

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:sp_enable_asm_fix
Dec 7, 2022
Merged

SP: --enable-sp-asm now enables SP if not set#5851
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:sp_enable_asm_fix

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

Description

Enabling SP with ASM didn't enable SP or error out when SP wasn't configured. Now enables SP when '' and errors when 'no'.

Testing

./configure --enable-sp-asm
./configure --enable-sp-asm --enable-sp=no
./configure --enable-sp-asm --disable-sp

Checklist

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

@SparkiDev SparkiDev assigned douzzer and SparkiDev and unassigned douzzer Dec 5, 2022
@SparkiDev SparkiDev force-pushed the sp_enable_asm_fix branch 2 times, most recently from de3c55c to 5cf4025 Compare December 6, 2022 04:40
@SparkiDev SparkiDev assigned dgarske and douzzer and unassigned SparkiDev Dec 6, 2022
Comment thread wolfcrypt/src/sp_c32.c Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not see the corresponding XFREE? Is DYNAMIC_TYPE_ECC the right type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@dgarske dgarske assigned SparkiDev and unassigned dgarske and douzzer Dec 6, 2022
Enabling SP with ASM didn't enable SP or error out when SP wasn't
configured. Now enables SP when '' and errors when 'no'.

SAKKE modinv used large amounts of stack. Change to have more temporary
memory allocated increased to cover the usage.
ECC, SAKKE: sp_<bits>_ecc_mulmod_<cpu><words>() used large amounts of
stack. Allocate when WOLFSSL_SMALL_STACK.

wc_DhCheckKeyPair() not available when HAVE_SELFTEST.
Wasn't compiled in before as WOLFSSL_HAVE_SP_DH wasn't defined.
@SparkiDev
Copy link
Copy Markdown
Contributor Author

After fix, with:
./configure '--disable-shared' '--enable-sakke' '--enable-sp-asm' '--enable-smallstack' '--enable-fpecc'
executing:
valgrind ./wolfcrypt/test/testwolfcrypt
shows no leaks

@dgarske dgarske self-assigned this Dec 6, 2022
@SparkiDev SparkiDev removed their assignment Dec 7, 2022
@dgarske dgarske merged commit f6cb13b into wolfSSL:master Dec 7, 2022
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