Skip to content

x.crypto: initial addition of curve25519 module#24748

Merged
spytheman merged 4 commits into
vlang:masterfrom
blackshirt:curve25519_inclusion
Jun 19, 2025
Merged

x.crypto: initial addition of curve25519 module#24748
spytheman merged 4 commits into
vlang:masterfrom
blackshirt:curve25519_inclusion

Conversation

@blackshirt

@blackshirt blackshirt commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

This PR was initial draft of addition of elliptic-curve curve25519 cryptographic module into x.crypto namespaces implemented in pure v. In my test, its solid enough to be included into that namespaces. Curve25519 is a high-speed elliptic curve used for Diffie-Hellman key exchange, a crucial part of the TLS handshake. TLS 1.3 adopted these curves as recommended algorithms, so, i think, inclusion into standard stock was a good addition.

In this PR, its currently support as building block and provides mechanism to creates shared secret for key exchange, through three functionality,

  • Through object based instances, think of key pair between curve25519 private and public key
  • Through expandable derive_shared_secret routine thats accepts some configurable options.
  • Through curve25519 Diffie-Hellman routine, called x25519, that working with raw bytes.

The minor thing included in this PR was the disabled of second type of type 2 of-RFC 7748 test vectors test. Its currently disabled, because its iterates lengthy and
need a very long times to complete. See the comment of the last test at test_x25519_after_iteration_from_rfc_vector_type2 test.

Cheers,
@blackshirt

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23152

@blackshirt blackshirt changed the title x.crypto.curve25519: initial addition curve25519 x.crypto.curve25519: initial addition of curve25519 module Jun 18, 2025
@blackshirt blackshirt changed the title x.crypto.curve25519: initial addition of curve25519 module x.crypto: initial addition of curve25519 module Jun 18, 2025
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v
Comment thread vlib/x/crypto/curve25519/README.md Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/curve25519.v Outdated
Comment thread vlib/x/crypto/curve25519/usage_test.v
@spytheman spytheman merged commit d32969e into vlang:master Jun 19, 2025
81 of 82 checks passed
@blackshirt

Copy link
Copy Markdown
Contributor Author

Thank you, i would play a bits for additional test on the given link additional test

@blackshirt blackshirt deleted the curve25519_inclusion branch June 19, 2025 04:42
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