Skip to content

x.crypto.chacha20poly1305: move up responsibility for allocs into higher caller#25574

Merged
spytheman merged 3 commits intovlang:masterfrom
blackshirt:psiv
Oct 24, 2025
Merged

x.crypto.chacha20poly1305: move up responsibility for allocs into higher caller#25574
spytheman merged 3 commits intovlang:masterfrom
blackshirt:psiv

Conversation

@blackshirt
Copy link
Copy Markdown
Contributor

@blackshirt blackshirt commented Oct 24, 2025

This patch was related with previous merged PR in #25569. This PR fundamentally does not changes the core functionality. The reason for this changes was to move up buffer allocation in psiv_encrypt_internal and psiv_gen_tag into the caller responsible to do that allocs, especially in .encrypt and .decrypt. It also acts as preliminary step to move into fixed arrays.

This patch contains changes in the means of :

  • The main one was a changed in the signature of psiv_encrypt_internal and psiv_gen_tag to accept output buffer as the first params and adapts in another places that call both of them.
  • Updates comments on the code
  • Removes out left unused remaining bits, ie split_tag helper
  • Adjust the tests

Thanks,
Cheers

@tankf33der
Copy link
Copy Markdown
Contributor

All passed. OK.

@blackshirt
Copy link
Copy Markdown
Contributor Author

All passed. OK.

Thank you

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.
Thank you @blackshirt 🙇🏻 .

@spytheman spytheman merged commit 75e78ab into vlang:master Oct 24, 2025
73 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