Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Replace 'blake2-rfc' with rust-crypto 'blake2' crate #12266

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Replace 'blake2-rfc' with rust-crypto 'blake2' crate #12266

merged 4 commits into from
Sep 15, 2022

Conversation

davxy
Copy link
Member

@davxy davxy commented Sep 14, 2022

Closes #12260

Added a couple of tests exercising an uncovered code path wrt key derivation (where blake2 was involved)


Performances of the two libraries were found to be approximately equal

Results using Substrate startup performance tests (CPU-SCORE MB/s). Bigger Is better.
Three samples...

- blake2        : 867, 861, 868
- blake2-rfc    : 868, 867, 862

Results using directly criterion: https://github.com/davxy/crypto-benches/tree/main/hash#blake2


Blake2-rfc is now pulled in only by parity-db. But I think that it can be replaced there as well...


polkadot companion: paritytech/polkadot#6019

@davxy davxy requested review from andresilva, a team, bkchr, koute and skunert September 14, 2022 12:52
@davxy davxy self-assigned this Sep 14, 2022
@davxy davxy added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 14, 2022
primitives/core/src/crypto.rs Show resolved Hide resolved
primitives/core/Cargo.toml Outdated Show resolved Hide resolved
@davxy davxy added the D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit label Sep 15, 2022
@davxy davxy merged commit 8bd5510 into paritytech:master Sep 15, 2022
@davxy davxy deleted the davxy/remove-blake2-rfc branch September 24, 2022 15:00
@davxy davxy mentioned this pull request Dec 7, 2022
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Replace 'blake2-rfc with rust-crypto 'blake2' crate
* Bump blake2 to 0.10.4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use one blake2 implementation
5 participants