sha3 1.0.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.clang-format +54 -0
- data/.document +4 -3
- data/.rdoc_options +10 -0
- data/.rspec +2 -2
- data/.rubocop.yml +5 -1
- data/CHANGELOG.md +23 -0
- data/Gemfile +11 -0
- data/LICENSE.txt +1 -1
- data/README.md +153 -63
- data/Rakefile +9 -3
- data/certs/io+sha3@jsg.io.pem +26 -0
- data/doc/sha3.rb +81 -0
- data/ext/sha3/config.h +26 -0
- data/ext/sha3/digest.c +636 -164
- data/ext/sha3/digest.h +71 -35
- data/ext/sha3/extconf.rb +47 -13
- data/ext/sha3/lib/common/align.h +33 -0
- data/ext/sha3/{brg_endian.h → lib/common/brg_endian.h} +8 -7
- data/ext/sha3/{KeccakHash.c → lib/high/Keccak/FIPS202/KeccakHash.c} +26 -25
- data/ext/sha3/{KeccakHash.h → lib/high/Keccak/FIPS202/KeccakHash.h} +34 -19
- data/ext/sha3/lib/high/Keccak/KeccakDuplex.c +81 -0
- data/ext/sha3/lib/high/Keccak/KeccakDuplex.h +73 -0
- data/ext/sha3/lib/high/Keccak/KeccakDuplex.inc +201 -0
- data/ext/sha3/lib/high/Keccak/KeccakSponge.c +95 -0
- data/ext/sha3/lib/high/Keccak/KeccakSponge.h +70 -0
- data/ext/sha3/lib/high/Keccak/KeccakSponge.inc +312 -0
- data/ext/sha3/lib/high/Keccak/PRG/KeccakPRG.c +61 -0
- data/ext/sha3/lib/high/Keccak/PRG/KeccakPRG.h +67 -0
- data/ext/sha3/lib/high/Keccak/PRG/KeccakPRG.inc +128 -0
- data/ext/sha3/lib/high/Keccak/SP800-185/SP800-185.c +93 -0
- data/ext/sha3/lib/high/Keccak/SP800-185/SP800-185.h +599 -0
- data/ext/sha3/lib/high/Keccak/SP800-185/SP800-185.inc +573 -0
- data/ext/sha3/lib/high/common/Phases.h +25 -0
- data/ext/sha3/lib/low/KeccakP-1600/common/KeccakP-1600-64.macros +758 -0
- data/ext/sha3/lib/low/KeccakP-1600/common/KeccakP-1600-unrolling.macros +305 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-SnP.h +50 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference.h +23 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference32BI.c +617 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-SnP.h +50 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.c +413 -0
- data/ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.h +23 -0
- data/ext/sha3/lib/low/common/PlSnP-Fallback.inc +291 -0
- data/ext/sha3/lib/low/common/SnP-Relaned.h +145 -0
- data/lib/sha3.rb +25 -28
- data.tar.gz.sig +0 -0
- metadata +73 -149
- metadata.gz.sig +0 -0
- data/.yardopts +0 -1
- data/ChangeLog.rdoc +0 -27
- data/certs/johanns.pem +0 -24
- data/ext/sha3/KeccakF-1600-interface.h +0 -40
- data/ext/sha3/KeccakSponge.c +0 -192
- data/ext/sha3/KeccakSponge.h +0 -113
- data/ext/sha3/Optimized64/KeccakF-1600-64.macros +0 -2199
- data/ext/sha3/Optimized64/KeccakF-1600-opt64-settings.h +0 -3
- data/ext/sha3/Optimized64/KeccakF-1600-opt64.c +0 -508
- data/ext/sha3/Optimized64/KeccakF-1600-unrolling.macros +0 -126
- data/ext/sha3/Optimized64/SnP-interface.h +0 -47
- data/ext/sha3/Reference/KeccakF-1600-reference.c +0 -311
- data/ext/sha3/Reference/KeccakF-reference.h +0 -26
- data/ext/sha3/Reference/SnP-FBWL-default.c +0 -96
- data/ext/sha3/Reference/SnP-FBWL-default.h +0 -26
- data/ext/sha3/Reference/SnP-interface.h +0 -42
- data/ext/sha3/Reference/displayIntermediateValues.c +0 -158
- data/ext/sha3/Reference/displayIntermediateValues.h +0 -34
- data/ext/sha3/SnP-Relaned.h +0 -249
- data/ext/sha3/sha3.c +0 -62
- data/ext/sha3/sha3.h +0 -26
- data/lib/sha3/doc.rb +0 -121
- data/lib/sha3/version.rb +0 -9
- data/sha3.gemspec +0 -53
- data/tests.sh +0 -28
metadata
CHANGED
@@ -1,140 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sha3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johanns Gregorian
|
8
|
-
|
9
|
-
bindir: exe
|
8
|
+
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
12
11
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
+
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
12
|
+
MIIEYDCCAsigAwIBAgIBATANBgkqhkiG9w0BAQsFADA7MRAwDgYDVQQDDAdpb19z
|
13
|
+
aGEzMRMwEQYKCZImiZPyLGQBGRYDanNnMRIwEAYKCZImiZPyLGQBGRYCaW8wHhcN
|
14
|
+
MjUwMzAxMDYxMTE1WhcNMjYwMzAxMDYxMTE1WjA7MRAwDgYDVQQDDAdpb19zaGEz
|
15
|
+
MRMwEQYKCZImiZPyLGQBGRYDanNnMRIwEAYKCZImiZPyLGQBGRYCaW8wggGiMA0G
|
16
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDMdO1oUQ9FzXYtfFktOXDx6oIf9uSk
|
17
|
+
mg+yfo7uvcyNSa4gsF4+CY/TOYNBtwlD25AlgDqpxVCHFwUaBD+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|
+
YwFBqP6G2+0e0EdIIMdbCDBTmJbFyBr6y4pzED/FvEFzhAmCKOcZ6RJ8H7hkX5rh
|
33
|
+
+L4c9pHTemc2sQl7kH+mrntu7pt6D4EM4FD5eyWujQN1ME7xvLIFm5SczqCzFDfe
|
34
|
+
UjZtrp/rHLfHln46RvB+a1NlMRWxtJ7mQc/CMEbT+cpHlzuYa9qGakA4TmMpK10h
|
35
|
+
uYUv/V6CD4iTEMby0dopwHt5NqE=
|
35
36
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
37
|
+
date: 2025-03-01 00:00:00.000000000 Z
|
37
38
|
dependencies:
|
38
39
|
- !ruby/object:Gem::Dependency
|
39
|
-
name:
|
40
|
+
name: rdoc
|
40
41
|
requirement: !ruby/object:Gem::Requirement
|
41
42
|
requirements:
|
42
43
|
- - "~>"
|
43
44
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
45
|
-
type: :
|
45
|
+
version: '6.12'
|
46
|
+
type: :runtime
|
46
47
|
prerelease: false
|
47
48
|
version_requirements: !ruby/object:Gem::Requirement
|
48
49
|
requirements:
|
49
50
|
- - "~>"
|
50
51
|
- !ruby/object:Gem::Version
|
51
|
-
version: '
|
52
|
-
|
53
|
-
|
54
|
-
requirement: !ruby/object:Gem::Requirement
|
55
|
-
requirements:
|
56
|
-
- - "~>"
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version: '13.0'
|
59
|
-
type: :development
|
60
|
-
prerelease: false
|
61
|
-
version_requirements: !ruby/object:Gem::Requirement
|
62
|
-
requirements:
|
63
|
-
- - "~>"
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: '13.0'
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
name: rake-compiler
|
68
|
-
requirement: !ruby/object:Gem::Requirement
|
69
|
-
requirements:
|
70
|
-
- - "~>"
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '1.1'
|
73
|
-
type: :development
|
74
|
-
prerelease: false
|
75
|
-
version_requirements: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '1.1'
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: rspec
|
82
|
-
requirement: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '3.11'
|
87
|
-
type: :development
|
88
|
-
prerelease: false
|
89
|
-
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - "~>"
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '3.11'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rubocop
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - "~>"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '1.25'
|
101
|
-
type: :development
|
102
|
-
prerelease: false
|
103
|
-
version_requirements: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - "~>"
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '1.25'
|
108
|
-
- !ruby/object:Gem::Dependency
|
109
|
-
name: rubocop-rake
|
110
|
-
requirement: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
- - "~>"
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version: '0.6'
|
115
|
-
type: :development
|
116
|
-
prerelease: false
|
117
|
-
version_requirements: !ruby/object:Gem::Requirement
|
118
|
-
requirements:
|
119
|
-
- - "~>"
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version: '0.6'
|
122
|
-
- !ruby/object:Gem::Dependency
|
123
|
-
name: rubocop-rspec
|
124
|
-
requirement: !ruby/object:Gem::Requirement
|
125
|
-
requirements:
|
126
|
-
- - "~>"
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: '2.9'
|
129
|
-
type: :development
|
130
|
-
prerelease: false
|
131
|
-
version_requirements: !ruby/object:Gem::Requirement
|
132
|
-
requirements:
|
133
|
-
- - "~>"
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: '2.9'
|
136
|
-
description: SHA3 for Ruby is a native (C) FIPS 202 compliant implementation of SHA3
|
137
|
-
(Keccak) cryptographic hashing algorithm.
|
52
|
+
version: '6.12'
|
53
|
+
description: A XKCP based native (C) binding to SHA3 (FIPS 202) cryptographic hashing
|
54
|
+
algorithm.
|
138
55
|
email:
|
139
56
|
- io+sha3@jsg.io
|
140
57
|
executables: []
|
@@ -142,54 +59,62 @@ extensions:
|
|
142
59
|
- ext/sha3/extconf.rb
|
143
60
|
extra_rdoc_files: []
|
144
61
|
files:
|
62
|
+
- ".clang-format"
|
145
63
|
- ".document"
|
64
|
+
- ".rdoc_options"
|
146
65
|
- ".rspec"
|
147
66
|
- ".rubocop.yml"
|
148
|
-
-
|
149
|
-
- ChangeLog.rdoc
|
67
|
+
- CHANGELOG.md
|
150
68
|
- Gemfile
|
151
69
|
- LICENSE.txt
|
152
70
|
- README.md
|
153
71
|
- Rakefile
|
154
|
-
- certs/
|
155
|
-
-
|
156
|
-
- ext/sha3/
|
157
|
-
- ext/sha3/KeccakHash.h
|
158
|
-
- ext/sha3/KeccakSponge.c
|
159
|
-
- ext/sha3/KeccakSponge.h
|
160
|
-
- ext/sha3/Optimized64/KeccakF-1600-64.macros
|
161
|
-
- ext/sha3/Optimized64/KeccakF-1600-opt64-settings.h
|
162
|
-
- ext/sha3/Optimized64/KeccakF-1600-opt64.c
|
163
|
-
- ext/sha3/Optimized64/KeccakF-1600-unrolling.macros
|
164
|
-
- ext/sha3/Optimized64/SnP-interface.h
|
165
|
-
- ext/sha3/Reference/KeccakF-1600-reference.c
|
166
|
-
- ext/sha3/Reference/KeccakF-reference.h
|
167
|
-
- ext/sha3/Reference/SnP-FBWL-default.c
|
168
|
-
- ext/sha3/Reference/SnP-FBWL-default.h
|
169
|
-
- ext/sha3/Reference/SnP-interface.h
|
170
|
-
- ext/sha3/Reference/displayIntermediateValues.c
|
171
|
-
- ext/sha3/Reference/displayIntermediateValues.h
|
172
|
-
- ext/sha3/SnP-Relaned.h
|
173
|
-
- ext/sha3/brg_endian.h
|
72
|
+
- certs/io+sha3@jsg.io.pem
|
73
|
+
- doc/sha3.rb
|
74
|
+
- ext/sha3/config.h
|
174
75
|
- ext/sha3/digest.c
|
175
76
|
- ext/sha3/digest.h
|
176
77
|
- ext/sha3/extconf.rb
|
177
|
-
- ext/sha3/
|
178
|
-
- ext/sha3/
|
78
|
+
- ext/sha3/lib/common/align.h
|
79
|
+
- ext/sha3/lib/common/brg_endian.h
|
80
|
+
- ext/sha3/lib/high/Keccak/FIPS202/KeccakHash.c
|
81
|
+
- ext/sha3/lib/high/Keccak/FIPS202/KeccakHash.h
|
82
|
+
- ext/sha3/lib/high/Keccak/KeccakDuplex.c
|
83
|
+
- ext/sha3/lib/high/Keccak/KeccakDuplex.h
|
84
|
+
- ext/sha3/lib/high/Keccak/KeccakDuplex.inc
|
85
|
+
- ext/sha3/lib/high/Keccak/KeccakSponge.c
|
86
|
+
- ext/sha3/lib/high/Keccak/KeccakSponge.h
|
87
|
+
- ext/sha3/lib/high/Keccak/KeccakSponge.inc
|
88
|
+
- ext/sha3/lib/high/Keccak/PRG/KeccakPRG.c
|
89
|
+
- ext/sha3/lib/high/Keccak/PRG/KeccakPRG.h
|
90
|
+
- ext/sha3/lib/high/Keccak/PRG/KeccakPRG.inc
|
91
|
+
- ext/sha3/lib/high/Keccak/SP800-185/SP800-185.c
|
92
|
+
- ext/sha3/lib/high/Keccak/SP800-185/SP800-185.h
|
93
|
+
- ext/sha3/lib/high/Keccak/SP800-185/SP800-185.inc
|
94
|
+
- ext/sha3/lib/high/common/Phases.h
|
95
|
+
- ext/sha3/lib/low/KeccakP-1600/common/KeccakP-1600-64.macros
|
96
|
+
- ext/sha3/lib/low/KeccakP-1600/common/KeccakP-1600-unrolling.macros
|
97
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-SnP.h
|
98
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference.h
|
99
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference32BI.c
|
100
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-SnP.h
|
101
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.c
|
102
|
+
- ext/sha3/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.h
|
103
|
+
- ext/sha3/lib/low/common/PlSnP-Fallback.inc
|
104
|
+
- ext/sha3/lib/low/common/SnP-Relaned.h
|
179
105
|
- lib/sha3.rb
|
180
|
-
- lib/sha3/doc.rb
|
181
|
-
- lib/sha3/version.rb
|
182
|
-
- sha3.gemspec
|
183
|
-
- tests.sh
|
184
106
|
homepage: https://github.com/johanns/sha3
|
185
107
|
licenses:
|
186
108
|
- MIT
|
187
109
|
metadata:
|
188
110
|
changelog_uri: https://github.com/johanns/sha3/CHANGELOG.md
|
189
111
|
homepage_uri: https://github.com/johanns/sha3
|
190
|
-
|
112
|
+
documentation_uri: https://docs.jsg.io/sha3/html/index.html
|
191
113
|
rubygems_mfa_required: 'true'
|
192
|
-
post_install_message:
|
114
|
+
post_install_message: |2
|
115
|
+
[NOTICE] SHA3 version 2.0 introduces breaking changes to the API.
|
116
|
+
Please review the changelog and ensure compatibility with your application.
|
117
|
+
If you need the previous behavior, lock your Gemfile to version '~> 1.0'."
|
193
118
|
rdoc_options: []
|
194
119
|
require_paths:
|
195
120
|
- lib
|
@@ -197,15 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
122
|
requirements:
|
198
123
|
- - ">="
|
199
124
|
- !ruby/object:Gem::Version
|
200
|
-
version: 2.
|
125
|
+
version: 2.7.0
|
201
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
127
|
requirements:
|
203
128
|
- - ">="
|
204
129
|
- !ruby/object:Gem::Version
|
205
130
|
version: '0'
|
206
131
|
requirements: []
|
207
|
-
rubygems_version: 3.2
|
208
|
-
signing_key:
|
132
|
+
rubygems_version: 3.6.2
|
209
133
|
specification_version: 4
|
210
134
|
summary: SHA3 (FIPS 202) cryptographic hashing algorithm
|
211
135
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
data/.yardopts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
lib/**/doc.rb lib/**/version.rb --markup rdoc --title "sha3 Documentation" --protected
|
data/ChangeLog.rdoc
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
=== 0.1.0 / 2012-10-04
|
2
|
-
|
3
|
-
* Initial release:
|
4
|
-
|
5
|
-
=== 0.1.1 / 2012-10-07
|
6
|
-
|
7
|
-
* Replaced Keccak reference code with optimized (~10x faster)
|
8
|
-
|
9
|
-
=== 0.2.0 / 2012-11-1
|
10
|
-
|
11
|
-
* SHA3::Digest: A proper ::Digest subclass.
|
12
|
-
|
13
|
-
=== 0.2.2 / 2012-12-14
|
14
|
-
|
15
|
-
* Added sub-class for each SHA3 supported bit-lengths (example: SHA3::Digest::SHA256). Minor bug fix.
|
16
|
-
|
17
|
-
=== 0.2.3 / 2013-1-28
|
18
|
-
|
19
|
-
* Added documentation file (decoupled form C source); refactored C source.
|
20
|
-
|
21
|
-
=== 0.2.4 / 2013-5-20
|
22
|
-
|
23
|
-
* Fixed instance copy validation code (YANKED)
|
24
|
-
|
25
|
-
=== 0.2.5 / 2013-5-21
|
26
|
-
|
27
|
-
* Fixed the fix to instance copy validation code.
|
data/certs/johanns.pem
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIEFDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9pby9E
|
3
|
-
Qz1qc2cvREM9aW8wHhcNMjIwMzA5MDcyODEwWhcNMjMwMzA5MDc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d3qwkgJ3ug3T28gkBWaTq8FSbTOfCVX9uNjQrukAP/VrfnKZiNnpJ7
|
19
|
-
FOtEKDk3l9JWCyX8LQwfljPmQhvFHYnMRyt0l2b0I5li6MWUE4JmrbtK8/Fyo0I0
|
20
|
-
PChRryVpy0HnKvqoKQyqeMspLbbKCsO1PRS5VFZ/ybrPy63paFPdikeKMZIH3oJQ
|
21
|
-
wePRJFEp3gdQZcSjfkzC38QFh9JuKFJFMC4Y3e5uVeeydEGGUekH1s/B5/EuBCRi
|
22
|
-
vaoldWA6C6e/X/XQsMNdC04+d7IdgNRf8NkN/atZdJLcFVcaXGS9MncPZnwBC2GD
|
23
|
-
GBMFs3s6mx0HRpclYTMXK71jLsfqtM2SriIbx1VqiuUMUtddNrGcOw==
|
24
|
-
-----END CERTIFICATE-----
|
@@ -1,40 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,
|
3
|
-
Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer, hereby
|
4
|
-
denoted as "the implementer".
|
5
|
-
|
6
|
-
For more information, feedback or questions, please refer to our websites:
|
7
|
-
http://keccak.noekeon.org/
|
8
|
-
http://keyak.noekeon.org/
|
9
|
-
http://ketje.noekeon.org/
|
10
|
-
|
11
|
-
To the extent possible under law, the implementer has waived all copyright
|
12
|
-
and related or neighboring rights to the source code in this file.
|
13
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
14
|
-
*/
|
15
|
-
|
16
|
-
#ifndef _KeccakF1600Interface_h_
|
17
|
-
#define _KeccakF1600Interface_h_
|
18
|
-
|
19
|
-
#include <string.h>
|
20
|
-
|
21
|
-
#define KeccakF_width 1600
|
22
|
-
#define KeccakF_laneInBytes 8
|
23
|
-
#define KeccakF_stateSizeInBytes (KeccakF_width/8)
|
24
|
-
#define KeccakF_1600
|
25
|
-
|
26
|
-
void KeccakF1600_Initialize( void );
|
27
|
-
void KeccakF1600_StateInitialize(void *state);
|
28
|
-
void KeccakF1600_StateXORBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length);
|
29
|
-
void KeccakF1600_StateOverwriteBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length);
|
30
|
-
void KeccakF1600_StateOverwriteWithZeroes(void *state, unsigned int byteCount);
|
31
|
-
void KeccakF1600_StateComplementBit(void *state, unsigned int position);
|
32
|
-
void KeccakF1600_StatePermute(void *state);
|
33
|
-
void KeccakF1600_StateExtractBytes(const void *state, unsigned char *data, unsigned int offset, unsigned int length);
|
34
|
-
void KeccakF1600_StateExtractAndXORBytes(const void *state, unsigned char *data, unsigned int offset, unsigned int length);
|
35
|
-
size_t KeccakF1600_FBWL_Absorb(void *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen, unsigned char trailingBits);
|
36
|
-
size_t KeccakF1600_FBWL_Squeeze(void *state, unsigned int laneCount, unsigned char *data, size_t dataByteLen);
|
37
|
-
size_t KeccakF1600_FBWL_Wrap(void *state, unsigned int laneCount, const unsigned char *dataIn, unsigned char *dataOut, size_t dataByteLen, unsigned char trailingBits);
|
38
|
-
size_t KeccakF1600_FBWL_Unwrap(void *state, unsigned int laneCount, const unsigned char *dataIn, unsigned char *dataOut, size_t dataByteLen, unsigned char trailingBits);
|
39
|
-
|
40
|
-
#endif
|
data/ext/sha3/KeccakSponge.c
DELETED
@@ -1,192 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,
|
3
|
-
Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer, hereby
|
4
|
-
denoted as "the implementer".
|
5
|
-
|
6
|
-
For more information, feedback or questions, please refer to our websites:
|
7
|
-
http://keccak.noekeon.org/
|
8
|
-
http://keyak.noekeon.org/
|
9
|
-
http://ketje.noekeon.org/
|
10
|
-
|
11
|
-
To the extent possible under law, the implementer has waived all copyright
|
12
|
-
and related or neighboring rights to the source code in this file.
|
13
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
14
|
-
*/
|
15
|
-
|
16
|
-
#include <string.h>
|
17
|
-
#include "KeccakSponge.h"
|
18
|
-
#include "SnP-interface.h"
|
19
|
-
#ifdef KeccakReference
|
20
|
-
#include "displayIntermediateValues.h"
|
21
|
-
#endif
|
22
|
-
|
23
|
-
/* ---------------------------------------------------------------- */
|
24
|
-
|
25
|
-
int Keccak_SpongeInitialize(Keccak_SpongeInstance *instance, unsigned int rate, unsigned int capacity)
|
26
|
-
{
|
27
|
-
if (rate+capacity != SnP_width)
|
28
|
-
return 1;
|
29
|
-
if ((rate <= 0) || (rate > SnP_width) || ((rate % 8) != 0))
|
30
|
-
return 1;
|
31
|
-
SnP_StaticInitialize();
|
32
|
-
SnP_Initialize(instance->state);
|
33
|
-
instance->rate = rate;
|
34
|
-
instance->byteIOIndex = 0;
|
35
|
-
instance->squeezing = 0;
|
36
|
-
|
37
|
-
return 0;
|
38
|
-
}
|
39
|
-
|
40
|
-
/* ---------------------------------------------------------------- */
|
41
|
-
|
42
|
-
int Keccak_SpongeAbsorb(Keccak_SpongeInstance *instance, const unsigned char *data, size_t dataByteLen)
|
43
|
-
{
|
44
|
-
size_t i, j;
|
45
|
-
unsigned int partialBlock;
|
46
|
-
const unsigned char *curData;
|
47
|
-
unsigned int rateInBytes = instance->rate/8;
|
48
|
-
|
49
|
-
if (instance->squeezing)
|
50
|
-
return 1; // Too late for additional input
|
51
|
-
|
52
|
-
i = 0;
|
53
|
-
curData = data;
|
54
|
-
while(i < dataByteLen) {
|
55
|
-
if ((instance->byteIOIndex == 0) && (dataByteLen >= (i + rateInBytes))) {
|
56
|
-
// processing full blocks first
|
57
|
-
if ((rateInBytes % SnP_laneLengthInBytes) == 0) {
|
58
|
-
// fast lane: whole lane rate
|
59
|
-
j = SnP_FBWL_Absorb(instance->state, rateInBytes/SnP_laneLengthInBytes, curData, dataByteLen - i, 0);
|
60
|
-
i += j;
|
61
|
-
curData += j;
|
62
|
-
}
|
63
|
-
else {
|
64
|
-
for(j=dataByteLen-i; j>=rateInBytes; j-=rateInBytes) {
|
65
|
-
#ifdef KeccakReference
|
66
|
-
displayBytes(1, "Block to be absorbed", curData, rateInBytes);
|
67
|
-
#endif
|
68
|
-
SnP_XORBytes(instance->state, curData, 0, rateInBytes);
|
69
|
-
SnP_Permute(instance->state);
|
70
|
-
curData+=rateInBytes;
|
71
|
-
}
|
72
|
-
i = dataByteLen - j;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
else {
|
76
|
-
// normal lane: using the message queue
|
77
|
-
partialBlock = (unsigned int)(dataByteLen - i);
|
78
|
-
if (partialBlock+instance->byteIOIndex > rateInBytes)
|
79
|
-
partialBlock = rateInBytes-instance->byteIOIndex;
|
80
|
-
#ifdef KeccakReference
|
81
|
-
displayBytes(1, "Block to be absorbed (part)", curData, partialBlock);
|
82
|
-
#endif
|
83
|
-
i += partialBlock;
|
84
|
-
|
85
|
-
SnP_XORBytes(instance->state, curData, instance->byteIOIndex, partialBlock);
|
86
|
-
curData += partialBlock;
|
87
|
-
instance->byteIOIndex += partialBlock;
|
88
|
-
if (instance->byteIOIndex == rateInBytes) {
|
89
|
-
SnP_Permute(instance->state);
|
90
|
-
instance->byteIOIndex = 0;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
94
|
-
return 0;
|
95
|
-
}
|
96
|
-
|
97
|
-
/* ---------------------------------------------------------------- */
|
98
|
-
|
99
|
-
int Keccak_SpongeAbsorbLastFewBits(Keccak_SpongeInstance *instance, unsigned char delimitedData)
|
100
|
-
{
|
101
|
-
unsigned char delimitedData1[1];
|
102
|
-
unsigned int rateInBytes = instance->rate/8;
|
103
|
-
|
104
|
-
if (delimitedData == 0)
|
105
|
-
return 1;
|
106
|
-
if (instance->squeezing)
|
107
|
-
return 1; // Too late for additional input
|
108
|
-
|
109
|
-
delimitedData1[0] = delimitedData;
|
110
|
-
#ifdef KeccakReference
|
111
|
-
displayBytes(1, "Block to be absorbed (last few bits + first bit of padding)", delimitedData1, 1);
|
112
|
-
#endif
|
113
|
-
// Last few bits, whose delimiter coincides with first bit of padding
|
114
|
-
SnP_XORBytes(instance->state, delimitedData1, instance->byteIOIndex, 1);
|
115
|
-
// If the first bit of padding is at position rate-1, we need a whole new block for the second bit of padding
|
116
|
-
if ((delimitedData >= 0x80) && (instance->byteIOIndex == (rateInBytes-1)))
|
117
|
-
SnP_Permute(instance->state);
|
118
|
-
// Second bit of padding
|
119
|
-
SnP_ComplementBit(instance->state, rateInBytes*8-1);
|
120
|
-
#ifdef KeccakReference
|
121
|
-
{
|
122
|
-
unsigned char block[SnP_width/8];
|
123
|
-
memset(block, 0, SnP_width/8);
|
124
|
-
block[rateInBytes-1] = 0x80;
|
125
|
-
displayBytes(1, "Second bit of padding", block, rateInBytes);
|
126
|
-
}
|
127
|
-
#endif
|
128
|
-
SnP_Permute(instance->state);
|
129
|
-
instance->byteIOIndex = 0;
|
130
|
-
instance->squeezing = 1;
|
131
|
-
#ifdef KeccakReference
|
132
|
-
displayText(1, "--- Switching to squeezing phase ---");
|
133
|
-
#endif
|
134
|
-
return 0;
|
135
|
-
}
|
136
|
-
|
137
|
-
/* ---------------------------------------------------------------- */
|
138
|
-
|
139
|
-
int Keccak_SpongeSqueeze(Keccak_SpongeInstance *instance, unsigned char *data, size_t dataByteLen)
|
140
|
-
{
|
141
|
-
size_t i, j;
|
142
|
-
unsigned int partialBlock;
|
143
|
-
unsigned int rateInBytes = instance->rate/8;
|
144
|
-
unsigned char *curData;
|
145
|
-
|
146
|
-
if (!instance->squeezing)
|
147
|
-
Keccak_SpongeAbsorbLastFewBits(instance, 0x01);
|
148
|
-
|
149
|
-
i = 0;
|
150
|
-
curData = data;
|
151
|
-
while(i < dataByteLen) {
|
152
|
-
if ((instance->byteIOIndex == rateInBytes) && (dataByteLen >= (i + rateInBytes))) {
|
153
|
-
// processing full blocks first
|
154
|
-
if ((rateInBytes % SnP_laneLengthInBytes) == 0) {
|
155
|
-
// fast lane: whole lane rate
|
156
|
-
j = SnP_FBWL_Squeeze(instance->state, rateInBytes/SnP_laneLengthInBytes, curData, dataByteLen - i);
|
157
|
-
i += j;
|
158
|
-
curData += j;
|
159
|
-
}
|
160
|
-
else {
|
161
|
-
for(j=dataByteLen-i; j>=rateInBytes; j-=rateInBytes) {
|
162
|
-
SnP_Permute(instance->state);
|
163
|
-
SnP_ExtractBytes(instance->state, curData, 0, rateInBytes);
|
164
|
-
#ifdef KeccakReference
|
165
|
-
displayBytes(1, "Squeezed block", curData, rateInBytes);
|
166
|
-
#endif
|
167
|
-
curData+=rateInBytes;
|
168
|
-
}
|
169
|
-
i = dataByteLen - j;
|
170
|
-
}
|
171
|
-
}
|
172
|
-
else {
|
173
|
-
// normal lane: using the message queue
|
174
|
-
if (instance->byteIOIndex == rateInBytes) {
|
175
|
-
SnP_Permute(instance->state);
|
176
|
-
instance->byteIOIndex = 0;
|
177
|
-
}
|
178
|
-
partialBlock = (unsigned int)(dataByteLen - i);
|
179
|
-
if (partialBlock+instance->byteIOIndex > rateInBytes)
|
180
|
-
partialBlock = rateInBytes-instance->byteIOIndex;
|
181
|
-
i += partialBlock;
|
182
|
-
|
183
|
-
SnP_ExtractBytes(instance->state, curData, instance->byteIOIndex, partialBlock);
|
184
|
-
#ifdef KeccakReference
|
185
|
-
displayBytes(1, "Squeezed block (part)", curData, partialBlock);
|
186
|
-
#endif
|
187
|
-
curData += partialBlock;
|
188
|
-
instance->byteIOIndex += partialBlock;
|
189
|
-
}
|
190
|
-
}
|
191
|
-
return 0;
|
192
|
-
}
|