-
Notifications
You must be signed in to change notification settings - Fork 85
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 salt/personalisation strings for Blake2b #105
Conversation
I realise this needs a version check, because the function doesn't exist in older libsodiums, too |
@namelessjon in the scrypt code, rather than an explicit version check, I was rescuing |
@namelessjon perhaps you could use |
It's a little more complex, as that also needs to modify the calls and raise if salt/personal is passed in to a non-supporting implementation |
Yep, it should only raise |
@namelessjon mind if I release |
Well, I went ahead and shipped 3.1.0, so... 😉 |
I do take slightly longer than 6 minutes to reply, especially while asleep. 👅 That said, was the right call. |
I will land this before you release 4.0.0. We can use that as an excuse to bump up the required library version up to 0.7.0 (as we'll need that for the SecretBuffer anyway). That way, there's no need to define the whole class two ways, to allow for sodium versions without the personal_salt blake variant. |
Cool, added it to the 4.0 milestone |
eaa7c7f
to
03752e4
Compare
This has now been updated for the size_t fix I made in the mainline. |
Plan on adding some tests? |
Tests? What are those? ;) More seriously, need to find some test vectors (probably from the sodium tests) |
They are exposed as options on the hash constructor. Strings are zero-padded out to 16 bytes. If they are not provided then a blank string is passed into the hash.
These use test vectors generated from reference C code
03752e4
to
091188e
Compare
There now with some tests. The vectors I generated myself using the reference implementation of blake2. |
Nice! Looking good from here |
Add salt/personalisation strings for Blake2b
Merged! |
w00p |
They are exposed as options on the hash constructor. Strings are
zero-padded out to 16 bytes. If they are not provided then a blank
string is passed into the hash.
Need to add some tests, but I've checked against the sodium vectors at least.