sha3 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sha3 might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +232 -22
- data/.travis.yml +16 -15
- data/Gemfile +1 -1
- data/Gemfile.ci +3 -9
- data/README.md +10 -35
- data/Rakefile +12 -14
- data/ext/sha3/digest.c +149 -131
- data/ext/sha3/digest.h +36 -28
- data/ext/sha3/extconf.rb +1 -1
- data/ext/sha3/sha3.c +46 -30
- data/ext/sha3/sha3.h +8 -7
- data/lib/sha3/version.rb +2 -3
- data/sha3.gemspec +12 -14
- data/spec/generate_tests.rb +21 -20
- data/tests.sh +7 -7
- metadata +18 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a4ff3a34d0d9bce72c2ccbfb6a8ad81d9107f538ad2635cab15274c8661dcb71
|
4
|
+
data.tar.gz: 8fdab8312082afb9783faf1f9ec2136c5e8812a482fc1a6f0afded96cc9d64a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a38d0f89905ad6f90fdcc4a29ad245aa5f82edfed8b227485623ad05bb591c9cf5493e93c9a93119197b801ef68217c5d165b61a27c9a66ad175343ab89f1e
|
7
|
+
data.tar.gz: 497c72e85ad814301adbb4f71c11f53e1434b9b660e70847eb0939bf30faa883d73215740cd425048978b9c1e71c8f2917eed1819a5ed15b12e74076253190a0
|
data/.gitignore
CHANGED
@@ -1,24 +1,234 @@
|
|
1
|
+
|
2
|
+
# Created by https://www.toptal.com/developers/gitignore/api/c,clion,visualstudiocode,ruby
|
3
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=c,clion,visualstudiocode,ruby
|
4
|
+
|
5
|
+
### C ###
|
6
|
+
# Prerequisites
|
7
|
+
*.d
|
8
|
+
|
9
|
+
# Object files
|
10
|
+
*.o
|
11
|
+
*.ko
|
12
|
+
*.obj
|
13
|
+
*.elf
|
14
|
+
|
15
|
+
# Linker output
|
16
|
+
*.ilk
|
17
|
+
*.map
|
18
|
+
*.exp
|
19
|
+
|
20
|
+
# Precompiled Headers
|
21
|
+
*.gch
|
22
|
+
*.pch
|
23
|
+
|
24
|
+
# Libraries
|
25
|
+
*.lib
|
26
|
+
*.a
|
27
|
+
*.la
|
28
|
+
*.lo
|
29
|
+
|
30
|
+
# Shared objects (inc. Windows DLLs)
|
31
|
+
*.dll
|
32
|
+
*.so
|
33
|
+
*.so.*
|
34
|
+
*.dylib
|
35
|
+
|
36
|
+
# Executables
|
37
|
+
*.exe
|
38
|
+
*.out
|
39
|
+
*.app
|
40
|
+
*.i*86
|
41
|
+
*.x86_64
|
42
|
+
*.hex
|
43
|
+
|
44
|
+
# Debug files
|
45
|
+
*.dSYM/
|
46
|
+
*.su
|
47
|
+
*.idb
|
48
|
+
*.pdb
|
49
|
+
|
50
|
+
# Kernel Module Compile Results
|
51
|
+
*.mod*
|
52
|
+
*.cmd
|
53
|
+
.tmp_versions/
|
54
|
+
modules.order
|
55
|
+
Module.symvers
|
56
|
+
Mkfile.old
|
57
|
+
dkms.conf
|
58
|
+
|
59
|
+
### CLion ###
|
60
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
61
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
62
|
+
|
63
|
+
# User-specific stuff
|
64
|
+
.idea/**/workspace.xml
|
65
|
+
.idea/**/tasks.xml
|
66
|
+
.idea/**/usage.statistics.xml
|
67
|
+
.idea/**/dictionaries
|
68
|
+
.idea/**/shelf
|
69
|
+
|
70
|
+
# Generated files
|
71
|
+
.idea/**/contentModel.xml
|
72
|
+
|
73
|
+
# Sensitive or high-churn files
|
74
|
+
.idea/**/dataSources/
|
75
|
+
.idea/**/dataSources.ids
|
76
|
+
.idea/**/dataSources.local.xml
|
77
|
+
.idea/**/sqlDataSources.xml
|
78
|
+
.idea/**/dynamic.xml
|
79
|
+
.idea/**/uiDesigner.xml
|
80
|
+
.idea/**/dbnavigator.xml
|
81
|
+
|
82
|
+
# Gradle
|
83
|
+
.idea/**/gradle.xml
|
84
|
+
.idea/**/libraries
|
85
|
+
|
86
|
+
# Gradle and Maven with auto-import
|
87
|
+
# When using Gradle or Maven with auto-import, you should exclude module files,
|
88
|
+
# since they will be recreated, and may cause churn. Uncomment if using
|
89
|
+
# auto-import.
|
90
|
+
# .idea/artifacts
|
91
|
+
# .idea/compiler.xml
|
92
|
+
# .idea/jarRepositories.xml
|
93
|
+
# .idea/modules.xml
|
94
|
+
# .idea/*.iml
|
95
|
+
# .idea/modules
|
96
|
+
# *.iml
|
97
|
+
# *.ipr
|
98
|
+
|
99
|
+
# CMake
|
100
|
+
cmake-build-*/
|
101
|
+
|
102
|
+
# Mongo Explorer plugin
|
103
|
+
.idea/**/mongoSettings.xml
|
104
|
+
|
105
|
+
# File-based project format
|
106
|
+
*.iws
|
107
|
+
|
108
|
+
# IntelliJ
|
109
|
+
out/
|
110
|
+
|
111
|
+
# mpeltonen/sbt-idea plugin
|
112
|
+
.idea_modules/
|
113
|
+
|
114
|
+
# JIRA plugin
|
115
|
+
atlassian-ide-plugin.xml
|
116
|
+
|
117
|
+
# Cursive Clojure plugin
|
118
|
+
.idea/replstate.xml
|
119
|
+
|
120
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
121
|
+
com_crashlytics_export_strings.xml
|
122
|
+
crashlytics.properties
|
123
|
+
crashlytics-build.properties
|
124
|
+
fabric.properties
|
125
|
+
|
126
|
+
# Editor-based Rest Client
|
127
|
+
.idea/httpRequests
|
128
|
+
|
129
|
+
# Android studio 3.1+ serialized cache file
|
130
|
+
.idea/caches/build_file_checksums.ser
|
131
|
+
|
132
|
+
### CLion Patch ###
|
133
|
+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
134
|
+
|
135
|
+
# *.iml
|
136
|
+
# modules.xml
|
137
|
+
# .idea/misc.xml
|
138
|
+
# *.ipr
|
139
|
+
|
140
|
+
# Sonarlint plugin
|
141
|
+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
142
|
+
.idea/**/sonarlint/
|
143
|
+
|
144
|
+
# SonarQube Plugin
|
145
|
+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
146
|
+
.idea/**/sonarIssues.xml
|
147
|
+
|
148
|
+
# Markdown Navigator plugin
|
149
|
+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
150
|
+
.idea/**/markdown-navigator.xml
|
151
|
+
.idea/**/markdown-navigator-enh.xml
|
152
|
+
.idea/**/markdown-navigator/
|
153
|
+
|
154
|
+
# Cache file creation bug
|
155
|
+
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
156
|
+
.idea/$CACHE_FILE$
|
157
|
+
|
158
|
+
# CodeStream plugin
|
159
|
+
# https://plugins.jetbrains.com/plugin/12206-codestream
|
160
|
+
.idea/codestream.xml
|
161
|
+
|
162
|
+
### Ruby ###
|
1
163
|
*.gem
|
2
164
|
*.rbc
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
165
|
+
/.config
|
166
|
+
/coverage/
|
167
|
+
/InstalledFiles
|
168
|
+
/pkg/
|
169
|
+
/spec/reports/
|
170
|
+
/spec/examples.txt
|
171
|
+
/test/tmp/
|
172
|
+
/test/version_tmp/
|
173
|
+
/tmp/
|
174
|
+
|
175
|
+
# Used by dotenv library to load environment variables.
|
176
|
+
# .env
|
177
|
+
|
178
|
+
# Ignore Byebug command history file.
|
179
|
+
.byebug_history
|
180
|
+
|
181
|
+
## Specific to RubyMotion:
|
182
|
+
.dat*
|
183
|
+
.repl_history
|
184
|
+
build/
|
185
|
+
*.bridgesupport
|
186
|
+
build-iPhoneOS/
|
187
|
+
build-iPhoneSimulator/
|
188
|
+
|
189
|
+
## Specific to RubyMotion (use of CocoaPods):
|
190
|
+
#
|
191
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
192
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
193
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
194
|
+
# vendor/Pods/
|
195
|
+
|
196
|
+
## Documentation cache and generated files:
|
197
|
+
/.yardoc/
|
198
|
+
/_yardoc/
|
199
|
+
/doc/
|
200
|
+
/rdoc/
|
201
|
+
|
202
|
+
## Environment normalization:
|
203
|
+
/.bundle/
|
204
|
+
/vendor/bundle
|
205
|
+
/lib/bundler/man/
|
206
|
+
|
207
|
+
# for a library or gem, you might want to ignore these files since the code is
|
208
|
+
# intended to run in multiple environments; otherwise, check them in:
|
209
|
+
# Gemfile.lock
|
210
|
+
# .ruby-version
|
211
|
+
# .ruby-gemset
|
212
|
+
|
213
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
214
|
+
.rvmrc
|
215
|
+
|
216
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
217
|
+
# .rubocop-https?--*
|
218
|
+
|
219
|
+
### Ruby Patch ###
|
220
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
221
|
+
# .rubocop-https?--*
|
222
|
+
|
223
|
+
### VisualStudioCode ###
|
224
|
+
.vscode/*
|
225
|
+
!.vscode/tasks.json
|
226
|
+
!.vscode/launch.json
|
227
|
+
*.code-workspace
|
228
|
+
|
229
|
+
### VisualStudioCode Patch ###
|
230
|
+
# Ignore all local history of files
|
231
|
+
.history
|
232
|
+
.ionide
|
233
|
+
|
234
|
+
# End of https://www.toptal.com/developers/gitignore/api/c,clion,visualstudiocode,ruby
|
data/.travis.yml
CHANGED
@@ -1,23 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
-
|
4
|
-
- 2.1.0
|
5
|
-
- 2.0.0
|
6
|
-
- 1.9.3
|
7
|
-
- 1.9.2
|
8
|
-
- 1.8.7
|
9
|
-
- rbx-2
|
10
|
-
|
11
|
-
gemfile: Gemfile.ci
|
1
|
+
arch:
|
2
|
+
- amd64
|
3
|
+
- arm64
|
12
4
|
|
13
5
|
branches:
|
14
6
|
only:
|
15
7
|
- master
|
8
|
+
- develop
|
9
|
+
|
10
|
+
gemfile: Gemfile.ci
|
11
|
+
|
12
|
+
language: ruby
|
16
13
|
|
17
14
|
os:
|
18
15
|
- linux
|
19
|
-
- osx
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
rvm:
|
18
|
+
- ruby-head
|
19
|
+
- 2.7
|
20
|
+
- 2.6
|
21
|
+
- 2.5
|
22
|
+
- 2.4
|
23
|
+
- 2.3
|
24
|
+
- 2.2
|
data/Gemfile
CHANGED
data/Gemfile.ci
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'rubygems-tasks'
|
6
5
|
gem 'rake'
|
7
|
-
gem 'rspec'
|
6
|
+
gem 'rspec'
|
7
|
+
gem 'rubygems-tasks'
|
8
8
|
gem 'yard'
|
9
|
-
|
10
|
-
platforms :rbx do
|
11
|
-
gem 'racc'
|
12
|
-
gem 'rubysl', '~> 2.0'
|
13
|
-
gem 'psych'
|
14
|
-
end
|
data/README.md
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# sha3
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/sha3.svg)](https://badge.fury.io/rb/sha3) [![CI](https://secure.travis-ci.org/johanns/sha3.png)](https://secure.travis-ci.org/johanns/sha3) [![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/sha3.svg)](https://badge.fury.io/rb/sha3) [![CI](https://secure.travis-ci.org/johanns/sha3.png)](https://secure.travis-ci.org/johanns/sha3) [![CodeClimate](https://codeclimate.com/github/johanns/sha3.png)](https://codeclimate.com/github/johanns/sha3)
|
4
4
|
|
5
5
|
**SHA3 for Ruby** is a native (C) binding to SHA3 (Keccak FIPS 202) cryptographic hashing algorithm.
|
6
6
|
|
7
|
-
- Home
|
8
|
-
- Issues
|
9
|
-
- Documentation
|
7
|
+
- [Home](https://github.com/johanns/sha3#readme)
|
8
|
+
- [Issues](https://github.com/johanns/sha3/issues)
|
9
|
+
- [Documentation](http://rubydoc.info/gems/sha3/frames)
|
10
10
|
|
11
11
|
## Warnings
|
12
12
|
|
13
|
-
-
|
14
|
-
-
|
13
|
+
- Please do NOT use SHA3 to hash passwords -- use a slow hashing function instead (e.g.: `pbkdf2`, `argon2`, `bcrypt` or `scrypt`)
|
14
|
+
- Version 1.0 introduces new API and is incompatible with previous versions (0.x).
|
15
15
|
|
16
16
|
## Module details
|
17
17
|
|
@@ -97,7 +97,7 @@ s = SHA3::Digest.file("tests.sh")
|
|
97
97
|
* Native build tools (e.g., GCC, Minigw, etc.)
|
98
98
|
* Gems: rubygems-tasks, rake, rspec, yard
|
99
99
|
|
100
|
-
### Testing
|
100
|
+
### Testing
|
101
101
|
|
102
102
|
Call ```rake``` to run the included RSpec tests.
|
103
103
|
|
@@ -107,39 +107,14 @@ Only a small subset of test vectors are included in the source repository; howev
|
|
107
107
|
|
108
108
|
### Rubies
|
109
109
|
|
110
|
-
|
110
|
+
Supported Ruby versions:
|
111
111
|
|
112
|
-
- MRI Ruby-
|
113
|
-
- MRI 2.1.0
|
114
|
-
- MRI 2.0.0
|
115
|
-
- MRI 1.9.3
|
116
|
-
- MRI 1.9.2
|
117
|
-
- MRI 1.8.7
|
118
|
-
- Rubinius 2
|
112
|
+
- MRI Ruby 2.4 - 3.0
|
119
113
|
|
120
|
-
On:
|
121
114
|
|
122
|
-
- Ubuntu 12.04, 12.10, 13.04, 14.04, 15.04
|
123
|
-
- Windows 7, 8, 8.1, 10
|
124
|
-
- Mac OS X 10.6 - 10.11
|
125
|
-
|
126
|
-
## Releases
|
127
|
-
|
128
|
-
- *1.0.1* :: FIPS 202 compliance (breaks compatibility with earlier releases)
|
129
|
-
- *0.2.6* :: Fixed bug #4
|
130
|
-
- *0.2.5* :: Bug fixes. (See ChangeLog.rdoc)
|
131
|
-
- *0.2.4* :: Bug fixes. (YANKED)
|
132
|
-
- *0.2.3* :: Added documentation file (decoupled form C source); refactored C source.
|
133
|
-
- *0.2.2* :: Added sub-class for each SHA3 supported bit-lengths (example: SHA3::Digest::SHA256). Minor bug fix.
|
134
|
-
- *0.2.0* :: Production worthy, but breaks API compatibility with 0.1.x. Backward-compatibility will be maintained henceforth.
|
135
|
-
- *0.1.x* :: Alpha code, and not suitable for production.
|
136
|
-
|
137
|
-
## TO DO
|
138
|
-
|
139
|
-
- Add SHAKE128/256 support
|
140
115
|
|
141
116
|
## Copyright
|
142
117
|
|
143
|
-
Copyright (c) 2012 -
|
118
|
+
Copyright (c) 2012 - 2020 Johanns Gregorian (https://github.com/johanns)
|
144
119
|
|
145
120
|
**See LICENSE.txt for details.**
|
data/Rakefile
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'rubygems'
|
4
2
|
require 'rake'
|
5
3
|
|
@@ -10,34 +8,34 @@ begin
|
|
10
8
|
Gem::Tasks.new
|
11
9
|
rescue LoadError => e
|
12
10
|
warn e.message
|
13
|
-
warn
|
11
|
+
warn 'Run `gem install rubygems-tasks` to install Gem::Tasks.'
|
14
12
|
end
|
15
13
|
|
16
14
|
begin
|
17
|
-
gem 'rspec'
|
15
|
+
gem 'rspec'
|
18
16
|
require 'rspec/core/rake_task'
|
19
17
|
|
20
18
|
RSpec::Core::RakeTask.new
|
21
|
-
rescue LoadError
|
19
|
+
rescue LoadError
|
22
20
|
task :spec do
|
23
|
-
abort
|
21
|
+
abort 'Please run `gem install rspec` to install RSpec.'
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
27
|
-
task :
|
28
|
-
task :
|
25
|
+
task test: :spec
|
26
|
+
task default: %i[compile spec]
|
29
27
|
|
30
28
|
begin
|
31
29
|
gem 'yard'
|
32
30
|
require 'yard'
|
33
31
|
|
34
32
|
YARD::Rake::YardocTask.new
|
35
|
-
rescue LoadError
|
33
|
+
rescue LoadError
|
36
34
|
task :yard do
|
37
|
-
abort
|
35
|
+
abort 'Please run `gem install yard` to install YARD.'
|
38
36
|
end
|
39
37
|
end
|
40
|
-
task :
|
38
|
+
task doc: :yard
|
41
39
|
|
42
40
|
begin
|
43
41
|
gem 'rake-compiler'
|
@@ -47,10 +45,10 @@ begin
|
|
47
45
|
ext.name = 'sha3_n'
|
48
46
|
ext.ext_dir = 'ext/sha3'
|
49
47
|
ext.tmp_dir = 'tmp'
|
50
|
-
ext.source_pattern =
|
48
|
+
ext.source_pattern = '*.{c}'
|
51
49
|
end
|
52
|
-
rescue LoadError
|
50
|
+
rescue LoadError
|
53
51
|
task :compile do
|
54
|
-
abort
|
52
|
+
abort 'Please run `gem install rake-compiler` to install Rake-Compiler.'
|
55
53
|
end
|
56
54
|
end
|