Repository navigation
blake2b/blake2s support - #3116
Conversation
Doesn't support keying, personalization, salting, or tree hashes so the API is pretty simple right now.
|
|
|
||
| .. note:: | ||
|
|
||
| As of OpenSSL 1.1.0 BLAKE2 is only supported as an unkeyed hash with no |
There was a problem hiding this comment.
I think this either needs to be un-keyed or be in the wordlist.
|
Turns out |
|
I guess I'll add |
| BLAKE2 | ||
| ~~~~~~ | ||
|
|
||
| `BLAKE2`_ is a cryptographic hash function specified in :rfc:`7693`. It supports |
| .. note:: | ||
|
|
||
| As of OpenSSL 1.1.0 BLAKE2 is only supported as an unkeyed hash with no | ||
| personalization or salting features. |
There was a problem hiding this comment.
I think it's confusing to mention all these features that we don't have, maybe it's better to just omit them for now? Or at least drop them from the opening paragraph and make the note "While the RFC describes for Blake2, currently these are not supported."
This will make BLAKE2 alternate digest size errors a bit less confusing
|
So I think this looks good, one clarifying quesiton: there's exactly one value that will work for digest_size in either of the blake2s, is that right? |
|
Correct. For blake2b only 64 works, and for blake2s only 32 works with OpenSSL 1.1.0. |
|
@reaperhulk how much sense does it really make to expose those options then? |
|
Can you add a changelog entry? |
|
@alex We could hide |
|
It's true we've avoided defaults (and documented our prediliction for doing so!). I can't help feel this is different, but don't have a constructive reason for arguing so though. It's easier to add a default than to remove one though, so this is fine :-) 👍 to clearly documenting this. Will merge after that + changelog. |
Doesn't support keying, personalization, salting, or tree hashes so the API is pretty simple right now.
Two outstanding questions:
BLAKE2supports configurable digest sizes. However, our interface forHashAlgorithmrequires the presence of adigest_size, which needs to be provided in the constructor forBLAKE2(either that or we'll need to generate 96 different classes). At the moment OpenSSL does not currently support anything other than the blake2b 64 byte out put and the blake2s 32 byte output, but it will likely support changing this in the future. I am inclined to say we should removedigest_sizefrom the interface rather than the filthydigest_size = Noneworkaround that's currently in this PR.Do we want to add
personalization,salt, andkeyto the API now and just error if any of them are passed to the openssl backend? Or do we want to add them later.I'll add the rest of the tests for coverage once we decide on these issues.