mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
sp-core-hashing: use the digest::Digest trait to handle the hashing function uniformly (#10835)
* sp-core-hashing: use sha3 instead of tiny-keccak Signed-off-by: koushiro <koushiro.cqx@gmail.com> * use blake2 instead of blake2-rfc Signed-off-by: koushiro <koushiro.cqx@gmail.com> * improve som hashing of sp-core and sp-api-proc-macro Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Some nits Signed-off-by: koushiro <koushiro.cqx@gmail.com> * cargo fmt Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -348,11 +348,7 @@ impl<'a> TryFrom<&'a Signature> for (libsecp256k1::Signature, libsecp256k1::Reco
|
||||
/// Derive a single hard junction.
|
||||
#[cfg(feature = "full_crypto")]
|
||||
fn derive_hard_junction(secret_seed: &Seed, cc: &[u8; 32]) -> Seed {
|
||||
("Secp256k1HDKD", secret_seed, cc).using_encoded(|data| {
|
||||
let mut res = [0u8; 32];
|
||||
res.copy_from_slice(blake2_rfc::blake2b::blake2b(32, &[], data).as_bytes());
|
||||
res
|
||||
})
|
||||
("Secp256k1HDKD", secret_seed, cc).using_encoded(|data| sp_core_hashing::blake2_256(data))
|
||||
}
|
||||
|
||||
/// An error when deriving a key.
|
||||
|
||||
@@ -396,11 +396,7 @@ impl From<&Public> for CryptoTypePublicPair {
|
||||
/// Derive a single hard junction.
|
||||
#[cfg(feature = "full_crypto")]
|
||||
fn derive_hard_junction(secret_seed: &Seed, cc: &[u8; 32]) -> Seed {
|
||||
("Ed25519HDKD", secret_seed, cc).using_encoded(|data| {
|
||||
let mut res = [0u8; 32];
|
||||
res.copy_from_slice(blake2_rfc::blake2b::blake2b(32, &[], data).as_bytes());
|
||||
res
|
||||
})
|
||||
("Ed25519HDKD", secret_seed, cc).using_encoded(|data| sp_core_hashing::blake2_256(data))
|
||||
}
|
||||
|
||||
/// An error when deriving a key.
|
||||
|
||||
Reference in New Issue
Block a user