-
Notifications
You must be signed in to change notification settings - Fork 271
Blake2 rework #17
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
Blake2 rework #17
Conversation
I relied on 0.3.0's support for statically customized hash output size (specifically, I use a 200-bit hash because it divides evenly into both bytes and base 36). This seems to break my use case. |
BLAKE2 defines variable size output as a simple truncation, so this code from compiler perspective will behave identically to the old approach: use blake2::Blake2b;
use digest::{Digest, VariableOutput};
let hasher = Blake2b::new();
// do hashing
let hash = [0u8; 200];
hasher.variable_result(&mut hash[..]); |
Thanks! However, doesn't the 0.3.0 code place the output size in the parameter block, as specified in the RFC? It seems like the new approach would be non-conformant and yield different hashes. |
Oh... It indeed looks like my mistake and overlook while reworking the crate. Thank you for noticing this! I will try fix this issue until the end of the week. |
Thanks! No particular urgency, since 0.3.0 is still working fine for me and I can always construct a parameter block manually if I really need to, but it's good to know support is intended. |
Rework of blake2 crate based on
blake2-rfc
. (with the consent of Cesar)