1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#![no_std]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_root_url = "https://docs.rs/fsb/0.1.2"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
#![allow(non_snake_case)]
#[macro_use]
mod macros;
use core::fmt;
pub use digest::{self, Digest};
static PI: &[u8; 272384] = include_bytes!("pi.bin");
use digest::{
block_buffer::Eager,
core_api::{
AlgorithmName, Block, BlockSizeUser, Buffer, BufferKindUser, CoreWrapper, FixedOutputCore,
OutputSizeUser, Reset, UpdateCore,
},
typenum::Unsigned,
HashMarker, Output,
};
fsb_impl!(
Fsb160,
Fsb160Core,
160,
U60,
U20,
5 << 18,
80,
640,
653,
1120,
"FSB-160 hasher state",
"Core FSB-160 hasher state",
);
fsb_impl!(
Fsb224,
Fsb224Core,
224,
U84,
U28,
7 << 18,
112,
896,
907,
1568,
"FSB-224 hasher state",
"Core FSB-224 hasher state",
);
fsb_impl!(
Fsb256,
Fsb256Core,
256,
U96,
U32,
1 << 21,
128,
1024,
1061,
1792,
"FSB-256 hasher state",
"Core FSB-256 hasher state",
);
fsb_impl!(
Fsb384,
Fsb384Core,
384,
U115,
U48,
23 << 16,
184,
1472,
1483,
2392,
"FSB-384 hasher state",
"Core FSB-384 hasher state",
);
fsb_impl!(
Fsb512,
Fsb512Core,
512,
U155,
U64,
31 << 16,
248,
1984,
1987,
3224,
"FSB-512 hasher state",
"Core FSB-512 hasher state",
);