-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Use one blake2 implementation #12260
Comments
|
Hm, I was referring to RustCrypto/hashes#360 I'm not sure it is used in Substrate (honestly didn't check), but if one is superior in terms of feature set and comparable in performance, there is a higher chance of pulling the other dependency indirectly anyway. Still beneficial to have one dependency in Substrate, but both will be compiled in the end. |
I've made a small recognition and looks like (as I was expecting) the keyed hash is not used within the Substrate repo: substrate/primitives/core/src/crypto.rs Line 135 in 23bb5a6
^ This is a blake2-256 substrate/primitives/core/src/crypto.rs Lines 369 to 374 in 23bb5a6
^ This is a blake2-512 Parity-db is using the keyed version in one place: But I think that the interface of |
I noticed that Substrate uses both
blake2
andblake2-rfc
crates directly.If there a specific reason for doing so or can we unify usage to one of them (presumably
blake2
as it seems to be more common in general and is shared by indirect dependencies likesnow
) instead and remove extra dependency?NOTE:
blake2-rfc
is also used inparity-db
, so to remove it from dependency tree updatingparity-db
will be necessary as well.UPD:
blake2
doesn't support keyed hashing, so maybeblake2-rfc
is the better option for now 🤷♂️The text was updated successfully, but these errors were encountered: