Skip to content

Add NID_X25519 and NID_X448 support to the EVP layer#10552

Merged
JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
julek-wolfssl:evp-x25519-x448
May 28, 2026
Merged

Add NID_X25519 and NID_X448 support to the EVP layer#10552
JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
julek-wolfssl:evp-x25519-x448

Conversation

@julek-wolfssl
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2026 17:23
@julek-wolfssl julek-wolfssl self-assigned this May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_PKEY struct with curve25519/curve448 member pointers plus ownCurve25519/ownCurve448 ownership bits, and add WC_EVP_PKEY_X25519/X448 enum values mapped to the corresponding WC_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, and wolfSSL_EVP_PKEY_free, using little-endian RFC 7748 conventions and the existing per-PKEY RNG (with wc_curve25519_set_rng blinding when enabled).
  • Add test_wolfSSL_EVP_PKEY_x25519 / test_wolfSSL_EVP_PKEY_x448 unit tests covering raw import length checks, sign rejection, key generation, and symmetric ECDH agreement; register them in TEST_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.

@julek-wolfssl julek-wolfssl marked this pull request as ready for review May 28, 2026 18:03
@github-actions
Copy link
Copy Markdown

retest this please

@JacobBarthelmeh JacobBarthelmeh merged commit beff858 into wolfSSL:master May 28, 2026
577 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.

4 participants