-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add Blake2b-256
, Blake2b-128
, etc. as wrappers over VarBlake2b
.
#67
Comments
Yes, we should do it as part of |
Forgot to ask: can you do a PR with these updates? |
Most people will want 128, 256, 512 versions only, and they can be always changed to whatever is the best option for the internal type, in the future, no? In a backward compat way, for whichever method is used. So is there any point to complicate everything with |
I could do it with a simple macro... :D |
Crates already have been "complicated" with |
Ok then I'll see what I can do. |
I would like to confirm something? Is the only difference between Blake with 512bit output and Blake with 256bit output, that the shorter one does everything the same and takes only first 32 bytes of the result? Is this standardized somewhere, arbitrary, common convention? I'm not a cryptographer. |
As a rule, the NIST competition bit size specifiers correspond to both security level and output size, which creates a mess. It's why you should use shake128/256, not sha3. I donno about blake2b specifically, but good for them if they avoided that noise. |
@burdges From (wikipeidia)[https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE2]:
So I guess the block size is different, which probably leads to different hashes? The thing is, in my code I already used existing |
I tested it, and it looks like |
Different output sizes use a slightly different initialization of initial state, so it's not a simple truncation. I will look into your PR to if you've missed something. |
I found it quite inconsistent that |
@nazar-pc |
It looks like some crates want a
D: Digest<OutputSize = U64> + Default
as an argument to what hash to use, so thatVarBlake2b
is not very useful on it's own. Eg. dalek-cryptography/ed25519-dalek#59I could write my own wrapper, but if I need it, other people will, too.
The text was updated successfully, but these errors were encountered: