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

Refactor chacha20poly1305 module #11

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

nyonson
Copy link
Collaborator

@nyonson nyonson commented Mar 21, 2024

Went down a few rabbit holes here, so this PR is very dense.

Updated the poly1305 implementation to be a little more robust and match the RFC spec. Before we were depending on the ChaCha20Poly1305 AEAD which just so happen to align on 16 bytes. Now the poly1305 implementation handles the 0x01 byte marker correctly at the end of the message and uses a "leftovers" array so that the add and tag interface hasn't changed.

Dropped the third party chacha20poly1305 deps we were using for testing and replaced the tests with the one from the RFC. Probably can add some more here.

Moved the ChaCha20 and Poly1305 modules into the ChaCha20Poly1305 module since we are kinda hard coding some of the aspects to the ChaCha20Poly1305 standard.

@nyonson nyonson force-pushed the chore/document-poly1305 branch from fd634d0 to b85ca3c Compare March 22, 2024 19:57
@nyonson nyonson marked this pull request as ready for review March 22, 2024 20:04
@rustaceanrob rustaceanrob merged commit 1e18f74 into rust-bitcoin:main Mar 22, 2024
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.

2 participants