Skip to content

Commit

Permalink
Add wrapper types for hashers
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Aug 9, 2023
1 parent 5d8b7f0 commit 3f40bd1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ use crate::{
keys::SecretKey,
};

/// Wrapper type for 256- and 512-bit `Blake2b` hashers
pub type Blake2b256 = Blake2b<U32>;
pub type Blake2b512 = Blake2b<U64>;

/// The `DomainSeparation` trait is used to inject domain separation tags into the [`DomainSeparatedHasher`] in a
/// way that can be applied consistently, but without hard-coding anything into the hasher itself.
///
Expand Down Expand Up @@ -418,9 +422,9 @@ impl LengthExtensionAttackResistant for Blake2bVar {}

impl LengthExtensionAttackResistant for Sha3_256 {}

impl LengthExtensionAttackResistant for Blake2b<U32> {}
impl LengthExtensionAttackResistant for Blake2b256 {}

impl LengthExtensionAttackResistant for Blake2b<U64> {}
impl LengthExtensionAttackResistant for Blake2b512 {}

//------------------------------------------------ HMAC ------------------------------------------------------------
/// A domain separation tag for use in MAC derivation algorithms.
Expand Down

0 comments on commit 3f40bd1

Please sign in to comment.