Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial addition of chacha20 stream cipher module under vlib/x/crypto namespace #20417

Merged
merged 24 commits into from Jan 7, 2024

Conversation

blackshirt
Copy link
Contributor

@blackshirt blackshirt commented Jan 6, 2024

This pull request add ChaCha20 symetric stream cipher encryption under the new vlib/x/crypto namespace. Its acts as places for supplemetary (or experimental) crypto-related library, like Go did.
This implementation mostly based on RFC 8439 and trying to get as close as possible to the inspiring Go version of chacha20 library.

For this initial PR, it's support two's mode of nonce size, standard size of IETF RFC 8439, ie 12 bytes, and extended nonce size, ie, 24 bytes, based on XChaCha20

Please give a review, thought or feedback. All are welcome.
Thanks

@blackshirt
Copy link
Contributor Author

@spytheman thanks for reviewing it

@JalonSolov
Copy link
Contributor

JalonSolov commented Jan 6, 2024

Since most of the functions properly check array bounds already, you may want to try some benchmarks to see if adding the @[direct_array_access] attribute will improve the speed (not that it's exactly slow, now, but faster is always better if it still gets the correct answers 😄).

@spytheman
Copy link
Member

@blackshirt to fix ./vlib/x/crypto/chacha20/README.md:11:1: error: example is not formatted, run VAUTOFIX=1 ./v check-md -hide-warning vlib/x/crypto/chacha20/README.md 2 times, and commit the result.

spytheman and others added 2 commits January 6, 2024 22:33
blackshirt and others added 14 commits January 7, 2024 05:58
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
@blackshirt
Copy link
Contributor Author

Since most of the functions properly check array bounds already, you may want to try some benchmarks to see if adding the @[direct_array_access] attribute will improve the speed (not that it's exactly slow, now, but faster is always better if it still gets the correct answers 😄).

I would try writes some preliminary Benchmark in next PR..btw, its in my plan..thanks for suggestion)

blackshirt and others added 4 commits January 7, 2024 06:11
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
@blackshirt
Copy link
Contributor Author

@blackshirt to fix ./vlib/x/crypto/chacha20/README.md:11:1: error: example is not formatted, run VAUTOFIX=1 ./v check-md -hide-warning vlib/x/crypto/chacha20/README.md 2 times, and commit the result.

Thanks, its done in latest changes

Copy link
Member

@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 66d222c into vlang:master Jan 7, 2024
41 of 42 checks passed
@blackshirt
Copy link
Contributor Author

blackshirt commented Jan 7, 2024

Excellent work.

Thanks ..with help from great people and awesome vlang communities...
Btw, thanks for all the fixs.

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.

None yet

3 participants