Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curve25519: add blinding when using private key #8392

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

SparkiDev
Copy link
Contributor

@SparkiDev SparkiDev commented Jan 29, 2025

Description

XOR in random value to scalar and perform special scalar multiplication.

Fixes zd#19039

Testing

/configure '--disable-shared' '--enable-curve25519' 'CFLAGS=-DWOLFSSL_CURVE25519_BLINDING' '--disable-intelasm' --enable-opensslall
/configure '--disable-shared' '--enable-curve25519=no128bit' 'CFLAGS=-DWOLFSSL_CURVE25519_BLINDING' '--disable-intelasm' --enable-opensslall

Checklist

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

Sorry, something went wrong.

@SparkiDev SparkiDev self-assigned this Jan 29, 2025
@SparkiDev SparkiDev force-pushed the curve25519_blinding branch from ce2aaef to 432bc81 Compare January 29, 2025 23:12
@SparkiDev SparkiDev force-pushed the curve25519_blinding branch 2 times, most recently from 7c44a4c to fb4de99 Compare February 11, 2025 07:15
@SparkiDev
Copy link
Contributor Author

retest this please

@SparkiDev SparkiDev force-pushed the curve25519_blinding branch 2 times, most recently from 62942f5 to b883da2 Compare February 12, 2025 00:06
@SparkiDev SparkiDev marked this pull request as ready for review February 12, 2025 00:08
@SparkiDev
Copy link
Contributor Author

SparkiDev commented Feb 12, 2025

retest this please

valgrind testing failed with hudson error

@SparkiDev SparkiDev assigned wolfSSL-Bot and unassigned SparkiDev Feb 12, 2025
dgarske
dgarske previously approved these changes Feb 12, 2025
Copy link
Contributor

@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.

This all looks good and tests out correctly for the larger FE/GE math (without asm).

Do we need to handle the small case too?

./configure --enable-curve25519=small CFLAGS="-DWOLFSSL_CURVE25519_BLINDING" && make
...
  CCLD     src/libwolfssl.la
Undefined symbols for architecture x86_64:
  "_curve25519_blind", referenced from:
      _curve25519_smul_blind in src_libwolfssl_la-curve25519.o
ld: symbol(s) not found for architecture x86_64

XOR in random value to scalar and perform special scalar multiplication.
Multiply x3 and z3 by random value to randomize co-ordinates.

Add new APIs to support passing in an RNG.
Old APIs create a new RNG.

Only needed for the C implementations that are not small.

Modified TLS and OpenSSL compat API implementations to pass in RNG.

Fixed tests and benchmark program to pass in RNG.
@SparkiDev
Copy link
Contributor Author

Added a compile time check for blinding with options not supporting it.

@SparkiDev SparkiDev assigned dgarske and unassigned wolfSSL-Bot Feb 13, 2025
@dgarske dgarske merged commit 846ba43 into wolfSSL:master Feb 13, 2025
174 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.

None yet

3 participants