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

Blake2 rework #17

Merged
merged 11 commits into from
Mar 6, 2017
Merged

Blake2 rework #17

merged 11 commits into from
Mar 6, 2017

Conversation

newpavlov
Copy link
Member

Rework of blake2 crate based on blake2-rfc. (with the consent of Cesar)

@newpavlov newpavlov self-assigned this Mar 3, 2017
@newpavlov newpavlov mentioned this pull request Mar 6, 2017
@newpavlov newpavlov merged commit 398cd89 into master Mar 6, 2017
@newpavlov newpavlov deleted the blake2-rework branch March 6, 2017 14:29
@Ralith
Copy link

Ralith commented Jun 15, 2017

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.

@newpavlov
Copy link
Member Author

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[..]);

@Ralith
Copy link

Ralith commented Jun 15, 2017

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.

@newpavlov
Copy link
Member Author

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.

@Ralith
Copy link

Ralith commented Jun 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants