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
use thiserror::Error;
#[macro_use]
mod tools;
constructor::construct_fixed_hashes!(
H128 {
size = 128,
},
H160 {
size = 160,
},
H224 {
size = 224,
},
H256 {
size = 256,
},
H384 {
size = 384,
},
H512 {
size = 512,
},
H520 {
size = 520,
},
H1024 {
size = 1024,
},
H2048 {
size = 2048,
},
H4096 {
size = 4096,
},
);
#[cfg(feature = "bits_128")]
convert_between!(U128, H128, 16);
#[cfg(feature = "bits_160")]
convert_between!(U160, H160, 20);
#[cfg(feature = "bits_224")]
convert_between!(U224, H224, 28);
#[cfg(feature = "bits_256")]
convert_between!(U256, H256, 32);
#[cfg(feature = "bits_384")]
convert_between!(U384, H384, 48);
#[cfg(feature = "bits_512")]
convert_between!(U512, H512, 64);
#[cfg(feature = "bits_520")]
convert_between!(U520, H520, 65);
#[cfg(feature = "bits_1024")]
convert_between!(U1024, H1024, 128);
#[cfg(feature = "bits_2048")]
convert_between!(U2048, H2048, 256);
#[cfg(feature = "bits_4096")]
convert_between!(U4096, H4096, 512);