Skip to content

Add additonal test for `x.crypto.curve25519' module#3

Merged
spytheman merged 1 commit intovlang:mainfrom
blackshirt:main
Jun 20, 2025
Merged

Add additonal test for `x.crypto.curve25519' module#3
spytheman merged 1 commit intovlang:mainfrom
blackshirt:main

Conversation

@blackshirt
Copy link
Copy Markdown
Contributor

@blackshirt blackshirt commented Jun 19, 2025

This PR contains additional tests for x.crypto.curve25519 module. The motivation comes from the talk at Discord.

In this PR, the tests basically contains two tests, ie

  • The main and the biggest one, was taken and adapted from Crafted x25519 test vectors, recommended by @tankf33der . These tests mostly has been adapted, but not all of them included, especially for the biggest special cases. Its only takes two or mores cases status for every item availables.
  • The second test was Type 2 of RFC 7748 test vectors included in the module's main test but still disabled due to long time to complete the full iteration. Its modified by reducing iteration number to reduce completion time of the test.

There are some cases in the test that i think should be handled correctly in the module, likes private key == -1 (mod order) case, private key == 1 (mod order) on twist case.
But, btw, this test was a good addition.

Thanks..and cheers

@tankf33der
Copy link
Copy Markdown

Originally tests came from wycheproof project by Google.

@blackshirt
Copy link
Copy Markdown
Contributor Author

Originally tests came from wycheproof project by Google.

Yeah, the link you give have cited it

Copy link
Copy Markdown
Contributor

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman spytheman merged commit 97bf726 into vlang:main Jun 20, 2025
3 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.

3 participants