wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

Add support for Curve25519 (AKA X25519) non-blocking key gen and shared secret.

Open haydenroche5 opened this issue 2 years ago • 1 comments

Description

Currently, this is only supported with --enable-curve25519=small (macro CURVE25519_SMALL). Additionally, this commit adds support for using these non-blocking operations in the context of TLS 1.2 with the wolfSSL async code. wolfSSL_UseKeyShare and TLSX_KeyShare_DeriveSecret need to be augmented to support async so that these non-blocking ops work with TLS 1.3.

See async PR 55 for the async changes needed for this feature to work with TLS.

Testing

Added temporary debug printfs to verify that the underlying non-blocking functions were being called hundreds of times over the course of a key gen/shared secret operation. Configuration:

./configure CFLAGS="-g3 -O0" CPPFLAGS="-DWC_X25519_NONBLOCK" --enable-curve25519=small --enable-asynccrypt --enable-asynccrypt-sw

Added a x25519 non-blocking test to test.c.

CURVE25519 non-block key gen: 508 times
CURVE25519 non-block shared secret: 510 times

haydenroche5 avatar Nov 02 '22 13:11 haydenroche5

Can one of the admins verify this patch?

wolfSSL-Bot avatar Feb 09 '23 20:02 wolfSSL-Bot