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

Are codes for Blake2b and Blake2s across implementations incosistent? #100

Closed
arnau opened this issue Sep 19, 2018 · 8 comments
Closed

Are codes for Blake2b and Blake2s across implementations incosistent? #100

arnau opened this issue Sep 19, 2018 · 8 comments

Comments

@arnau
Copy link

arnau commented Sep 19, 2018

Hello, I'm not sure I'm missing something important here but in the list of implementations some use {Blake2b 0x40, Blake2s 0x41} and others {Blake2b 0xb240, Blake2s 0xb260}. The latter agreeing with multibase and multihash CSV tables.

Are both valid? Are the former old/obsolete?

@Stebalien
Copy link
Member

No, the first ones look incorrect. Which implementation uses 0x40 and 0x41?

@Stebalien
Copy link
Member

Ah, interesting, it looks like it was changed a few years ago.

@Stebalien
Copy link
Member

It looks like this was changed to take into account the fact that these hash functions are parameterized over their length. 0xb240 is actually blake2b-512 while 0x40 didn't actually specify the length.

@Stebalien
Copy link
Member

One here: multiformats/clj-multihash#11

@arnau
Copy link
Author

arnau commented Sep 19, 2018

True, worth mentioning that the ongoing PR #41 still has a mention to the 0x40 and 0x41.

@ebkalderon
Copy link

The descriptions of the BLAKE2 hash codes on Multiformats.io and in the IETF draft spec for multihashes suggest that the correct codes for BLAKE2 are:

Algorithm Code
Blake2b-512 0xb240
Blake2b-256 0xb220
Blake2s-256 0xb260
Blake2s-128 0xb250

@arnau
Copy link
Author

arnau commented Sep 28, 2018

Looks like this issue has been solved. Perhaps it would be good to mention in the list of implementations the ones that are not up to date?

Thanks for the help 👍

@arnau arnau closed this as completed Sep 28, 2018
@Stebalien
Copy link
Member

I've been filing bugs but probably haven't found all of them.

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

No branches or pull requests

3 participants