Add NID_X25519 and NID_X448 support to the EVP layer#10552
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds X25519 (Curve25519) and X448 (Curve448) support to the OpenSSL-compatibility EVP layer so callers can use these algorithms via EVP_PKEY for raw-key import, key generation, and ECDH key derivation.
Changes:
- Extend
WOLFSSL_EVP_PKEYstruct withcurve25519/curve448member pointers plusownCurve25519/ownCurve448ownership bits, and addWC_EVP_PKEY_X25519/X448enum values mapped to the correspondingWC_NID_*constants. - Wire X25519/X448 into
wolfSSL_EVP_PKEY_new_raw_public_key,wolfSSL_EVP_PKEY_new_raw_private_key,wolfSSL_EVP_PKEY_keygen,wolfSSL_EVP_PKEY_derive,wolfSSL_EVP_PKEY_size, andwolfSSL_EVP_PKEY_free, using little-endian RFC 7748 conventions and the existing per-PKEY RNG (withwc_curve25519_set_rngblinding when enabled). - Add
test_wolfSSL_EVP_PKEY_x25519/test_wolfSSL_EVP_PKEY_x448unit tests covering raw import length checks, sign rejection, key generation, and symmetric ECDH agreement; register them inTEST_EVP_PKEY_DECLS.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/ssl.h | Add curve25519/curve448 pointer fields and ownership bitfields on WOLFSSL_EVP_PKEY. |
| wolfssl/openssl/evp.h | Add WC_EVP_PKEY_X25519/X448 enum values and EVP_PKEY_X25519/X448 compat macros. |
| wolfcrypt/src/evp.c | Implement X25519/X448 handling in keygen, derive, size, free; widen derive's enabling guard. |
| wolfcrypt/src/evp_pk.c | Implement raw public/private key import for X25519/X448 with length checks and ownership tracking. |
| tests/api/test_evp_pkey.h | Declare and register the two new test cases. |
| tests/api/test_evp_pkey.c | New unit tests exercising raw import, sign rejection, keygen and ECDH symmetry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
retest this please |
JacobBarthelmeh
approved these changes
May 28, 2026
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.
No description provided.