-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: x/crypto/blake2b,x/crypto/blake2s: Implement personalisation and salting #32447
Comments
For anyone looking for personalization/salt ASAP: I know of two abandoned projects that had that feature: https://github.com/codahale/blake2 and https://github.com/minio/blake2b-simd |
Sounds like the API would look like
Anybody see any way to simplify it? |
Do we need for both Blake2b and Blake2s? The latter doesn't even have arbitrary size hashes right now. #32417 |
Perhaps it's worth noting that blake3 switched away from salt & personalization. It still has |
Why is size needed for non-XOF hashes? I think it's either this API or a builder-pattern of sort, where you optionally input key/salt/personalization
I don't think we should consider blake3 here, it's way newer than blake2 and will take time before it can be considered a good choice for real world security applications IMO ( https://twitter.com/oconnor663/status/1257078936917377024 ) I'd really like to see this API implemented, I consider domain separation a huge security feature |
How would you select the hash output size otherwise? |
i'd add the options to the |
@FiloSottile Friendly ping :), yeah this API should work for us, (I'm interested in the hash.Hash one, but I assume this is also a good API for the XOF option). hasher, _ := blake2b.NewWithOptions(&Options{Personalization: "MyHash"}) Thanks! (I can also help with implementation/review if you want :) ) |
Actually, the New functions should return an error.
This looks good to me to implement. @rsc can we get this on the active proposal queue? |
Hi @rsc @FiloSottile |
Any ETA? |
The current implementations of BLAKE2b and BLAKE2s support both variable output lengths and keyed BLAKE2 (blake2b, blake2s), but do not yet enable setting the personalisation and salt sections of the parameter block. Personalisation in particular is becoming more commonplace in BLAKE2's usage within cryptographic protocols. It would be beneficial both inherently and for interoperability if the BLAKE2 implementations provided an interface for instantiating the digest state with a personalisation string and/or a salt.
The text was updated successfully, but these errors were encountered: