From 854be0e0c456a817c9eeb19790331f1cc579798b Mon Sep 17 00:00:00 2001 From: HeCorr Date: Sat, 10 Feb 2024 14:06:02 -0300 Subject: [PATCH] add missing common Blake2 states BLAKE2s-128 BLAKE2b-128 BLAKE2b-256 --- blake2/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/blake2/src/lib.rs b/blake2/src/lib.rs index 266c39ec..ef7d3e36 100644 --- a/blake2/src/lib.rs +++ b/blake2/src/lib.rs @@ -18,7 +18,7 @@ use core::{fmt, marker::PhantomData, ops::Div}; use digest::{ array::{Array, ArraySize}, block_buffer::{Lazy, LazyBuffer}, - consts::{U128, U32, U4, U64}, + consts::{U128, U16, U32, U4, U64}, core_api::{ AlgorithmName, Block, BlockSizeUser, Buffer, BufferKindUser, CoreWrapper, CtVariableCoreWrapper, OutputSizeUser, RtVariableCoreWrapper, TruncSide, UpdateCore, @@ -68,6 +68,10 @@ pub type Blake2bVar = RtVariableCoreWrapper; pub type Blake2bCore = CtVariableCoreWrapper; /// BLAKE2b generic over output size. pub type Blake2b = CoreWrapper>; +/// BLAKE2b-128 hasher state. +pub type Blake2b128 = Blake2b; +/// BLAKE2b-256 hasher state. +pub type Blake2b256 = Blake2b; /// BLAKE2b-512 hasher state. pub type Blake2b512 = Blake2b; @@ -98,6 +102,8 @@ pub type Blake2sVar = RtVariableCoreWrapper; pub type Blake2sCore = CtVariableCoreWrapper; /// BLAKE2s generic over output size. pub type Blake2s = CoreWrapper>; +/// BLAKE2s-128 hasher state. +pub type Blake2s128 = Blake2s; /// BLAKE2s-256 hasher state. pub type Blake2s256 = Blake2s;