From 3f40bd16e79d61b9e0f48ccf3077b3f8bd67f9b4 Mon Sep 17 00:00:00 2001 From: Aaron Feickert <66188213+AaronFeickert@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:14:41 -0500 Subject: [PATCH] Add wrapper types for hashers --- src/hashing.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hashing.rs b/src/hashing.rs index ea8758a1..3c74d1cb 100644 --- a/src/hashing.rs +++ b/src/hashing.rs @@ -47,6 +47,10 @@ use crate::{ keys::SecretKey, }; +/// Wrapper type for 256- and 512-bit `Blake2b` hashers +pub type Blake2b256 = Blake2b; +pub type Blake2b512 = Blake2b; + /// 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. /// @@ -418,9 +422,9 @@ impl LengthExtensionAttackResistant for Blake2bVar {} impl LengthExtensionAttackResistant for Sha3_256 {} -impl LengthExtensionAttackResistant for Blake2b {} +impl LengthExtensionAttackResistant for Blake2b256 {} -impl LengthExtensionAttackResistant for Blake2b {} +impl LengthExtensionAttackResistant for Blake2b512 {} //------------------------------------------------ HMAC ------------------------------------------------------------ /// A domain separation tag for use in MAC derivation algorithms.