Add X25519 non-blocking support and async example improvements#9721
Open
dgarske wants to merge 3 commits intowolfSSL:masterfrom
Open
Add X25519 non-blocking support and async example improvements#9721dgarske wants to merge 3 commits intowolfSSL:masterfrom
dgarske wants to merge 3 commits intowolfSSL:masterfrom
Conversation
e8fc0a8 to
50dea8f
Compare
Contributor
|
Jenkins retest this please - CI issue PRB-Master-Job |
Contributor
Author
|
Jenkins retest this please |
## Summary - Add non-blocking (incremental) Curve25519 key generation and shared secret via `WC_X25519_NONBLOCK`, modeled after the existing ECC non-blocking pattern (`WC_ECC_NONBLOCK`) - Implement `curve25519_nb()` and `fe_inv__distinct_nb()` in `fe_low_mem.c` as state-machine variants that return `FP_WOULDBLOCK` to yield after each field multiply - Add `wc_curve25519_set_nonblock()` API to attach/detach non-blocking context to a key - Integrate X25519 non-blocking with TLS 1.2/1.3 key share generation and shared secret in `tls.c` and `internal.c` (behind `WC_X25519_NONBLOCK && WOLFSSL_ASYNC_CRYPT_SW`) - Add `--enable-curve25519=nonblock` configure option (auto-enables `--enable-asynccrypt` and `--enable-asynccrypt-sw`) - Add X25519 async software dispatch cases in `async.c` and types in `async.h` - Fix async guard in `curve25519.c` to require `WOLFSSL_ASYNC_CRYPT_SW` (matching other algorithms) - Overhaul `examples/async/` client/server: non-blocking I/O via `WOLFSSL_USER_IO`, standalone `Makefile`, X25519/ECC mode selection, CI-friendly ready-file sync - Add `examples/configs/user_settings_curve25519nonblock.h` and CI coverage in `os-check.yml` and new `async-examples.yml` workflow - Add wolfcrypt test and API test coverage for X25519 non-blocking
…ion in SP ECC non-blocking.
Contributor
Author
|
Jenkins retest this please: "EOFException" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add non-blocking (non-blocking crypto) support for Curve25519 (X25519) key generation and shared secret. This enables
WC_X25519_NONBLOCKfor use with TLS, similar to the existingWC_ECC_NONBLOCKsupport. RequiresCURVE25519_SMALL(the smallfe_low_mem.cimplementation).New Features
wc_curve25519_make_key) and shared secret (wc_curve25519_shared_secret) usingFP_WOULDBLOCKyield pattern.curve25519_nb()function infe_low_mem.cwith state machine for iterative scalar multiplication.WC_X25519_NONBLOCKsupport insrc/tls.candsrc/internal.cfor key gen and ECDH during handshake.examples/async/) with standaloneMakefile(no configure needed).user_settings_curve25519nonblock.hexample config..github/workflows/async-examples.yml).WOLFSSL_STATIC_MEMORYsupport in async examples usingwolfSSL_CTX_load_static_memory.Fixes
curve25519.c— requireWOLFSSL_ASYNC_CRYPT_SWfor software async simulation symbols.sp_c32.c,sp_c64.c,sp_x86_64.c,sp_arm32.c,sp_arm64.c,sp_armthumb.c,sp_cortexm.c) — movetypedefbefore statements.register ... asm()pedantic warning on macOS insp_x86_64.cwith__APPLE__ && __MACH__guard.user_settings_curve25519nonblock.htoexamples/configs/include.am.Testing
WOLFSSL_SMALL_CERT_VERIFY,WOLFSSL_STATIC_MEMORY.WC_PENDING_Ecount >= 100 per test to confirm async crypto is exercised.wolfcrypt/test/test.cupdated with X25519 non-blocking test cases../configure --enable-curve25519=small CFLAGS="-DWC_X25519_NONBLOCK"and./configure CFLAGS="-DWC_X25519_NONBLOCK" --enable-curve25519=small --enable-asynccrypt.