@@ -2,13 +2,14 @@ package hashtools
2
2
3
3
import (
4
4
"crypto"
5
-
6
5
// Register SHA2 in Go's internal registry.
7
6
_ "crypto/sha256"
8
7
_ "crypto/sha512"
9
8
10
9
// Register SHA3 in Go's internal registry.
11
10
_ "golang.org/x/crypto/sha3"
11
+
12
+ "github.com/safing/jess/lhash"
12
13
)
13
14
14
15
func init () {
@@ -24,41 +25,47 @@ func init() {
24
25
BlockSize : crypto .SHA224 .New ().BlockSize (),
25
26
SecurityLevel : 112 ,
26
27
Author : "NSA, 2004" ,
28
+ labeledAlg : lhash .SHA2_224 ,
27
29
}))
28
30
Register (sha2Base .With (& HashTool {
29
31
Name : "SHA2-256" ,
30
32
Hash : crypto .SHA256 ,
31
33
DigestSize : crypto .SHA256 .Size (),
32
34
BlockSize : crypto .SHA256 .New ().BlockSize (),
33
35
SecurityLevel : 128 ,
36
+ labeledAlg : lhash .SHA2_256 ,
34
37
}))
35
38
Register (sha2Base .With (& HashTool {
36
39
Name : "SHA2-384" ,
37
40
Hash : crypto .SHA384 ,
38
41
DigestSize : crypto .SHA384 .Size (),
39
42
BlockSize : crypto .SHA384 .New ().BlockSize (),
40
43
SecurityLevel : 192 ,
44
+ labeledAlg : lhash .SHA2_384 ,
41
45
}))
42
46
Register (sha2Base .With (& HashTool {
43
47
Name : "SHA2-512" ,
44
48
Hash : crypto .SHA512 ,
45
49
DigestSize : crypto .SHA512 .Size (),
46
50
BlockSize : crypto .SHA512 .New ().BlockSize (),
47
51
SecurityLevel : 256 ,
52
+ labeledAlg : lhash .SHA2_512 ,
48
53
}))
49
54
Register (sha2Base .With (& HashTool {
50
55
Name : "SHA2-512-224" ,
51
56
Hash : crypto .SHA512_224 ,
52
57
DigestSize : crypto .SHA512_224 .Size (),
53
58
BlockSize : crypto .SHA512_224 .New ().BlockSize (),
54
59
SecurityLevel : 112 ,
60
+ labeledAlg : lhash .SHA2_512_224 ,
55
61
}))
56
62
Register (sha2Base .With (& HashTool {
57
63
Name : "SHA2-512-256" ,
58
64
Hash : crypto .SHA512_256 ,
59
65
DigestSize : crypto .SHA512_256 .Size (),
60
66
BlockSize : crypto .SHA512_256 .New ().BlockSize (),
61
67
SecurityLevel : 128 ,
68
+ labeledAlg : lhash .SHA2_512_256 ,
62
69
}))
63
70
64
71
// SHA3
@@ -72,26 +79,30 @@ func init() {
72
79
DigestSize : crypto .SHA3_224 .Size (),
73
80
BlockSize : crypto .SHA3_224 .New ().BlockSize (),
74
81
SecurityLevel : 112 ,
82
+ labeledAlg : lhash .SHA3_224 ,
75
83
}))
76
84
Register (sha3Base .With (& HashTool {
77
85
Name : "SHA3-256" ,
78
86
Hash : crypto .SHA3_256 ,
79
87
DigestSize : crypto .SHA3_256 .Size (),
80
88
BlockSize : crypto .SHA3_256 .New ().BlockSize (),
81
89
SecurityLevel : 128 ,
90
+ labeledAlg : lhash .SHA3_256 ,
82
91
}))
83
92
Register (sha3Base .With (& HashTool {
84
93
Name : "SHA3-384" ,
85
94
Hash : crypto .SHA3_384 ,
86
95
DigestSize : crypto .SHA3_384 .Size (),
87
96
BlockSize : crypto .SHA3_384 .New ().BlockSize (),
88
97
SecurityLevel : 192 ,
98
+ labeledAlg : lhash .SHA3_384 ,
89
99
}))
90
100
Register (sha3Base .With (& HashTool {
91
101
Name : "SHA3-512" ,
92
102
Hash : crypto .SHA3_512 ,
93
103
DigestSize : crypto .SHA3_512 .Size (),
94
104
BlockSize : crypto .SHA3_512 .New ().BlockSize (),
95
105
SecurityLevel : 256 ,
106
+ labeledAlg : lhash .SHA3_512 ,
96
107
}))
97
108
}
0 commit comments