-
Notifications
You must be signed in to change notification settings - Fork 13
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
Poly1305 refactor #48
Conversation
See str4d/rage#57 (comment) for an indication of the effect of this PR on ChaCha20Poly1305 performance. |
This path will be taken if the caller is exclusively using the UniversalHash trait. The original path might be taken if they are mixing in calls to Poly1305::update, which might result in partial blocks.
7284fc4
to
1d73f1c
Compare
When zeroize is enabled, Poly1305 implements Drop, and because soft::Poly1305State does not implement Copy, we cannot move it out of Poly1305.
use crate::{Tag, BLOCK_SIZE}; | ||
|
||
#[derive(Clone)] | ||
pub(crate) struct Poly1305State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer State
to Poly1305State
in the spirit of RFC#356 (although that deals specifically with modules, and not necessarily the name of the parent crate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good; I'll make this change in the next PR.
Will go ahead and merge this. If you agree with |
Improves throughput benchmarks by ~20%, due to a refactor included in poly1305 0.6: RustCrypto/universal-hashes#48
Makes the implementation more readable, sets the ground for #46, and also improves performance a bit!