-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathconsts.rs
More file actions
47 lines (43 loc) · 1.34 KB
/
consts.rs
File metadata and controls
47 lines (43 loc) · 1.34 KB
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
/// MD6 constants related to standard mode of operation
pub type Md6Word = u64;
pub type Md6ControlWord = u64;
pub type Md6NodeID = u64;
/// Maximum stack height
pub const MD6_MAX_STACK_HEIGHT: usize = 29;
/// Maximum number of rounds
pub const MD6_MAX_R: usize = 255;
/// Large so that MD6 is fully hierarchical
pub const MD6_DEFAULT_L: usize = 64;
/// Number of bits in a word (64)
pub const W: usize = 64;
/// Size of compression output in words (16)
pub const C: usize = 16;
/// Size of compression input block in words (89)
pub const N: usize = 89;
/// Q words in a compression block (>= 0) (15)
pub const Q: usize = 15;
/// Key words per compression block (>= 0) (8)
pub const K: usize = 8;
/// Words for unique node ID (0 or 64/w)
pub const U: usize = 1;
/// Words for control word (0 or 64/w)
pub const V: usize = 1;
/// Data words per compression block (> 0) (64)
pub const B: usize = 64;
const _: () = {
if Q + K + U + V + B != N {
panic!("`Q + K + U + V` must be equal to `N`");
}
};
/// Index for linear feedback
pub const T0: usize = 17;
/// Index for first input to first and
pub const T1: usize = 18;
/// Index for second input to first and
pub const T2: usize = 21;
/// Index for first input to second and
pub const T3: usize = 31;
/// Index for second input to second and
pub const T4: usize = 67;
/// Last tap
pub const T5: usize = 89;