Skip to content

initial addition of AEAD ChaCha20Poly1305 algorithm in pure v - #20817

Merged
spytheman merged 6 commits into
vlang:masterfrom
blackshirt:aead-for-x-crypto
Feb 14, 2024
Merged

spytheman merged 6 commits into
vlang:masterfrom
blackshirt:aead-for-x-crypto

Conversation

@blackshirt

@blackshirt blackshirt commented Feb 13, 2024 •

Copy link
Copy Markdown
Contributor

This pull request is the next step in two modules that have been merged into the experimental x.crypto namespace. This effort also adds to the completeness and capabilities of v crypto modules in the form of additional support for the authenticated encryption with additional data (AEAD) algorithm in pure V. See wiki about AEAD.

In this pull request opportunity, I included the AEAD interface which is actually more appropriate in crypto.cipher, but it doesn't matter where it is here, because this still needs review from the community and from experts. See the discussion on discord to find out his background and motivation.

This module is mostly inspired by the Golang version and attempts to align and conform to the RFC 8439 standard ChaCha20 and Poly1305 for IETF Protocols, with a few additions, likes supports two nonce sizes, 12 bytes length of RFC 8439 and 24 bytes length of extended nonce size, wich is backed up by x.crypto.chacha20 which supports both sizes. For extended nonce size, see XChaCha for more detail.

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

@JalonSolov

Copy link
Copy Markdown
Collaborator

Following RFC is good. Is there an RFC mentioning the 2 nonce sizes?

@blackshirt

blackshirt commented Feb 13, 2024 •

Copy link
Copy Markdown
Contributor Author

Following RFC is good. Is there an RFC mentioning the 2 nonce sizes?

Its already in x.crypto.chacha20 especially in xchacha20.v file for supporting extended ChaCha20 construction with 24 bytes nonce. For extended nonce size, see detail in XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305

Comment thread vlib/x/crypto/chacha20poly1305/usage_test.v Outdated
Comment thread vlib/x/crypto/chacha20poly1305/README.md
Comment thread vlib/x/crypto/chacha20poly1305/chacha20poly1305.v Outdated
Comment thread vlib/x/crypto/chacha20poly1305/chacha20poly1305.v Outdated
Comment thread vlib/x/crypto/chacha20poly1305/chacha20poly1305.v Outdated
@spytheman
spytheman merged commit 9476aed into vlang:master Feb 14, 2024
@blackshirt

Copy link
Copy Markdown
Contributor Author

Thank for merging it ...
Have a nice day

@blackshirt
blackshirt deleted the aead-for-x-crypto branch February 14, 2024 07:13
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