Skip to content

Conversation

@qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented Nov 21, 2025

No description provided.

@qmuntal qmuntal requested review from Copilot and gdams November 21, 2025 14:46
Copilot finished reviewing on behalf of qmuntal November 21, 2025 14:53
Copy link
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

This PR adds support for ECDH (Elliptic Curve Diffie-Hellman) key exchange using the X25519 curve. X25519 is a Montgomery curve widely used for key agreement, and this change extends the existing ECDH implementation to support it alongside the existing NIST P-curves (P-256, P-384, P-521).

Key changes:

  • Added X25519 constant definitions and OpenSSL bindings across multiple layers
  • Extended ECDH key generation, import/export, and key agreement to handle X25519's raw key format
  • Refactored ED25519 code to reuse common key extraction helpers

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/ossl/zossl_nocgo.go Added EVP_PKEY_Q_keygen_X25519 binding for no-CGO builds
internal/ossl/zossl_cgo.go Added EVP_PKEY_Q_keygen_X25519 binding for CGO builds
internal/ossl/zossl.h Added C function declaration and EVP_PKEY_X25519 constant
internal/ossl/zossl.go Added EVP_PKEY_X25519 Go constant
internal/ossl/zossl.c Added C wrapper implementation for X25519 key generation
internal/ossl/shims.h Added X25519 constant and function signature with variadic attribute
evp.go Integrated X25519 key generation into generateEVPPKey switch
ed25519.go Refactored to use shared extractPKEYRawPublic helper
ecdh_test.go Added comprehensive X25519 test coverage including vectors and edge cases
ecdh.go Extended ECDH implementation to handle X25519's raw key format
ec.go Added curveID function and extractPKEYRawPublic/extractPKEYRawPrivate helpers
const.go Added _KeyTypeX25519 string constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gdams gdams merged commit ee24449 into v2 Nov 21, 2025
112 checks passed
@gdams gdams deleted the dev/qmuntal/x25519 branch November 21, 2025 17:01
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.

3 participants