1use digest::{array::ArraySize, crypto_common::BlockSizes, typenum};
2
3pub trait Sealed {}
5
6pub trait OutputSize: ArraySize + Sealed {
10 type BlockSize: BlockSizes;
12}
13
14macro_rules! impl_sizes {
15 ($($variant:ident, $block_size:ident;)*) => {
16 $(
17 impl Sealed for typenum::$variant {}
18
19 impl OutputSize for typenum::$variant {
20 type BlockSize = typenum::$block_size;
21 }
22 )*
23 };
24}
25
26impl_sizes!(
27 U4, U184;
28 U8, U176;
29 U12, U168;
30 U16, U160;
31 U20, U152;
32 U24, U144;
33 U28, U136;
34 U32, U128;
35 U36, U120;
36 U40, U112;
37 U44, U104;
38 U48, U96;
39 U52, U88;
40 U56, U80;
41 U60, U72;
42 U64, U64;
43);