3737//! [1]: https://www.paris.inria.fr/secret/CBCrypto/index.php?pg=fsb
3838//! [2]: https://github.com/RustCrypto/hashes
3939
40- // #![no_std]
40+ #![ no_std]
4141#![ doc(
4242 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" ,
4343 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
4444) ]
4545#![ deny( unsafe_code) ]
4646#![ warn( missing_docs, rust_2018_idioms) ]
47-
4847#![ allow( non_snake_case) ]
4948
49+ extern crate alloc;
50+
5051#[ cfg( feature = "std" ) ]
5152extern crate std;
5253
53- #[ cfg( not( feature = "std" ) ) ]
54- extern crate alloc;
5554use alloc:: vec;
5655
5756#[ macro_use]
@@ -63,13 +62,77 @@ use whirlpool::Whirlpool;
6362
6463use core:: convert:: TryInto ;
6564
65+ use crate :: pi:: PI ;
6666use block_buffer:: BlockBuffer ;
67- use digest:: { generic_array:: GenericArray } ;
67+ use digest:: generic_array:: GenericArray ;
6868use digest:: { BlockInput , FixedOutputDirty , Reset , Update } ;
69- use crate :: pi:: PI ;
7069
71- fsb_impl ! ( Fsb160 , 160 , U60 , U20 , 5 << 18 , 80 , 640 , 653 , 1120 , "FSB-160 hash function." ) ;
72- fsb_impl ! ( Fsb224 , 224 , U84 , U28 , 7 << 18 , 112 , 896 , 907 , 1568 , "FSB-224 hash function." ) ;
73- fsb_impl ! ( Fsb256 , 256 , U96 , U32 , 1 << 21 , 128 , 1024 , 1061 , 1792 , "FSB-256 hash function." ) ;
74- fsb_impl ! ( Fsb384 , 384 , U115 , U48 , 23 << 16 , 184 , 1472 , 1483 , 2392 , "FSB-384 hash function." ) ;
75- fsb_impl ! ( Fsb512 , 512 , U155 , U64 , 31 << 16 , 248 , 1984 , 1987 , 3224 , "FSB-512 hash function." ) ;
70+ // FSB-160
71+ fsb_impl ! (
72+ Fsb160 ,
73+ 160 ,
74+ U60 ,
75+ U20 ,
76+ 5 << 18 ,
77+ 80 ,
78+ 640 ,
79+ 653 ,
80+ 1120 ,
81+ "FSB-160 hash function."
82+ ) ;
83+
84+ // FSB-224
85+ fsb_impl ! (
86+ Fsb224 ,
87+ 224 ,
88+ U84 ,
89+ U28 ,
90+ 7 << 18 ,
91+ 112 ,
92+ 896 ,
93+ 907 ,
94+ 1568 ,
95+ "FSB-224 hash function."
96+ ) ;
97+
98+ // FSB-256
99+ fsb_impl ! (
100+ Fsb256 ,
101+ 256 ,
102+ U96 ,
103+ U32 ,
104+ 1 << 21 ,
105+ 128 ,
106+ 1024 ,
107+ 1061 ,
108+ 1792 ,
109+ "FSB-256 hash function."
110+ ) ;
111+
112+ // FSB-384
113+ fsb_impl ! (
114+ Fsb384 ,
115+ 384 ,
116+ U115 ,
117+ U48 ,
118+ 23 << 16 ,
119+ 184 ,
120+ 1472 ,
121+ 1483 ,
122+ 2392 ,
123+ "FSB-384 hash function."
124+ ) ;
125+
126+ // FSB-512
127+ fsb_impl ! (
128+ Fsb512 ,
129+ 512 ,
130+ U155 ,
131+ U64 ,
132+ 31 << 16 ,
133+ 248 ,
134+ 1984 ,
135+ 1987 ,
136+ 3224 ,
137+ "FSB-512 hash function."
138+ ) ;
0 commit comments