Skip to content

Conversation

@davxy
Copy link
Member

@davxy davxy commented Sep 15, 2022

Currently Parity-DB is the only crate used by Substrate that is using blake2-rfc.

Everything else has been recently ported to RustCrypto blake2.


Please refer to this Substrate PR for some more details: paritytech/substrate#12266

@davxy davxy requested review from arkpar and cheme September 15, 2022 15:17
Comment on lines +145 to +146
let mut ctx = Blake2bMac::<U32>::new_with_salt_and_personal(salt, &[], &[])
.expect("Salt length (32) is a valid key length (<= 64)");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the naming is a bit misleading.

That is, with previous implementation the salt was used as the blake2b-rfc "key" argument while the key was used as the "data" argument.

The new_with_salt_and_personal has a dedicated parameter (the 2nd) for the salt. But to obtain the same MAC as before we have to pass salt as the 1st parameter

@davxy davxy merged commit 37245c7 into master Sep 15, 2022
@arkpar arkpar deleted the davxy/replace-blake2-rfc branch September 15, 2022 15:55
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

Successfully merging this pull request may close these issues.

3 participants