sha3 1.0.3 → 1.0.4
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.rspec +3 -1
- data/.rubocop.yml +6 -0
- data/Gemfile +3 -1
- data/README.md +3 -3
- data/Rakefile +10 -37
- data/certs/johanns.pem +24 -0
- data/ext/sha3/extconf.rb +7 -13
- data/lib/sha3/doc.rb +4 -4
- data/lib/sha3/version.rb +4 -4
- data/lib/sha3.rb +15 -13
- data/sha3.gemspec +52 -22
- data.tar.gz.sig +0 -0
- metadata +93 -28
- metadata.gz.sig +0 -0
- data/.gitignore +0 -234
- data/.travis.yml +0 -21
- data/Gemfile.ci +0 -8
- data/spec/generate_tests.rb +0 -49
- data/spec/sha3_core_spec.rb +0 -148
- data/spec/spec_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae66a849bd5438b3b6d3fa4f5d33505a75e6f64556bfacc21d0efcf03a7d41d8
|
4
|
+
data.tar.gz: dea6beac49eeaeb12829af4e87b36dfc19ac1b66bb7872a7c6884441a70cf814
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d374e5f716056d6d888d862f97bc07d433c74f4d721d2342cc09f7865571e47eec50f7b1ecd9b284aedb1c908393b0da249e0c474f5792e215097263928d9195
|
7
|
+
data.tar.gz: 6ea6442adf3c90ca8849576f8539835630d968a032b385447a9c95e2f4be97861910f510ba528dbe398990c2eb71fac6b3966816807571855b855afa8c6af15b
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# sha3
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/sha3.svg)](https://badge.fury.io/rb/sha3) [![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/sha3.svg)](https://badge.fury.io/rb/sha3) [![Ruby](https://github.com/johanns/sha3/actions/workflows/main.yml/badge.svg)](https://github.com/johanns/sha3/actions/workflows/main.yml)
|
4
4
|
|
5
5
|
**SHA3 for Ruby** is a native (C) binding to SHA3 (Keccak FIPS 202) cryptographic hashing algorithm.
|
6
6
|
|
@@ -109,12 +109,12 @@ Only a small subset of test vectors are included in the source repository; howev
|
|
109
109
|
|
110
110
|
Supported Ruby versions:
|
111
111
|
|
112
|
-
- MRI Ruby 2.4 - 3.
|
112
|
+
- MRI Ruby 2.4 - 3.1
|
113
113
|
|
114
114
|
|
115
115
|
|
116
116
|
## Copyright
|
117
117
|
|
118
|
-
Copyright (c) 2012 -
|
118
|
+
Copyright (c) 2012 - 2022 Johanns Gregorian (https://github.com/johanns)
|
119
119
|
|
120
120
|
**See LICENSE.txt for details.**
|
data/Rakefile
CHANGED
@@ -1,47 +1,18 @@
|
|
1
|
-
|
2
|
-
require 'rake'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
require 'rubygems/tasks'
|
7
|
-
|
8
|
-
Gem::Tasks.new
|
9
|
-
rescue LoadError => e
|
10
|
-
warn e.message
|
11
|
-
warn 'Run `gem install rubygems-tasks` to install Gem::Tasks.'
|
12
|
-
end
|
13
|
-
|
14
|
-
begin
|
15
|
-
gem 'rspec'
|
16
|
-
require 'rspec/core/rake_task'
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
17
5
|
|
18
|
-
|
19
|
-
rescue LoadError
|
20
|
-
task :spec do
|
21
|
-
abort 'Please run `gem install rspec` to install RSpec.'
|
22
|
-
end
|
23
|
-
end
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
24
7
|
|
25
|
-
|
26
|
-
task default: %i[compile spec]
|
8
|
+
require 'rubocop/rake_task'
|
27
9
|
|
28
|
-
|
29
|
-
gem 'yard'
|
30
|
-
require 'yard'
|
10
|
+
RuboCop::RakeTask.new
|
31
11
|
|
32
|
-
|
33
|
-
rescue LoadError
|
34
|
-
task :yard do
|
35
|
-
abort 'Please run `gem install yard` to install YARD.'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
task doc: :yard
|
12
|
+
require 'rake/extensiontask'
|
39
13
|
|
40
14
|
begin
|
41
|
-
|
42
|
-
require 'rake/extensiontask'
|
43
|
-
|
44
|
-
Rake::ExtensionTask.new do |ext|
|
15
|
+
Rake::ExtensionTask.new :compile do |ext|
|
45
16
|
ext.name = 'sha3_n'
|
46
17
|
ext.ext_dir = 'ext/sha3'
|
47
18
|
ext.tmp_dir = 'tmp'
|
@@ -52,3 +23,5 @@ rescue LoadError
|
|
52
23
|
abort 'Please run `gem install rake-compiler` to install Rake-Compiler.'
|
53
24
|
end
|
54
25
|
end
|
26
|
+
|
27
|
+
task default: %i[compile spec]
|
data/certs/johanns.pem
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIEFDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9pby9E
|
3
|
+
Qz1qc2cvREM9aW8wHhcNMjIwMzA5MDcyODEwWhcNMjMwMzA5MDcyODEwWjAaMRgw
|
4
|
+
FgYDVQQDDA9pby9EQz1qc2cvREM9aW8wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw
|
5
|
+
ggGKAoIBgQCuPwkDs4uoBV6pQhKp3uA58LkDPRR7VoI4QryuH7PbIwuO3xbuyR6T
|
6
|
+
xEqwcb9GgVnMxiFyXeVkWiriuGXqZ26Pp5zH/xxQNgPGCIyXuXeJMpASkWjJ9J6h
|
7
|
+
+jOdaG5jdL6zRcw/5XaJSQTLGO32BNOIezUZCF9JtMoEBQYHRWFjoD5BryjYnU3f
|
8
|
+
SstXg9nD8KOyk5Vzqk/wvJs5X+b2jcZL0KmSP1UgaCakfTCKf8LA9I5zAbvv2M9n
|
9
|
+
F0JQfKw4AUlmykzmOMEsITVxtM8lIVxm99KAS+lFn19xEjOs7nr3GktyLJxav8qI
|
10
|
+
3yXW/q5wUbOFrj/e1tk6r/W3bM6TQzGFBsBJgXEoFFZ+OQdEW8PXU0H5CIg59SxB
|
11
|
+
lXwSC1rKlxSeGNcKDXeIN1AU3pqv/PJj2SKg2+uQ9Staya0Mtek/caPDVfIy8AgH
|
12
|
+
ulTeTVN7m5SdVjVBl3rIehH/j0R/JF7ygsMkJEQAxrwPxqmazXkPAGLNNIqppaxi
|
13
|
+
VyHhxSnGefUCAwEAAaNlMGMwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
14
|
+
BBYEFBZFuuJYra4ctzMvtfzlTq3pW4idMBQGA1UdEQQNMAuBCWlvQGpzZy5pbzAU
|
15
|
+
BgNVHRIEDTALgQlpb0Bqc2cuaW8wDQYJKoZIhvcNAQELBQADggGBAF2jXh+4LzPg
|
16
|
+
Mj8gTCVTxj4/OhQ303cS5gasgh+R9Zxcf1cfTXOxEeIXdrqJiMhILWVWgCYZxagL
|
17
|
+
B5pU6MOyIOi4XAm5RMO3mIyTrY05Q/JbQ5j2ccuIOlL+XvhjAYKZmt9BkJLKfLEp
|
18
|
+
hagXHZe40Hd3qwkgJ3ug3T28gkBWaTq8FSbTOfCVX9uNjQrukAP/VrfnKZiNnpJ7
|
19
|
+
FOtEKDk3l9JWCyX8LQwfljPmQhvFHYnMRyt0l2b0I5li6MWUE4JmrbtK8/Fyo0I0
|
20
|
+
PChRryVpy0HnKvqoKQyqeMspLbbKCsO1PRS5VFZ/ybrPy63paFPdikeKMZIH3oJQ
|
21
|
+
wePRJFEp3gdQZcSjfkzC38QFh9JuKFJFMC4Y3e5uVeeydEGGUekH1s/B5/EuBCRi
|
22
|
+
vaoldWA6C6e/X/XQsMNdC04+d7IdgNRf8NkN/atZdJLcFVcaXGS9MncPZnwBC2GD
|
23
|
+
GBMFs3s6mx0HRpclYTMXK71jLsfqtM2SriIbx1VqiuUMUtddNrGcOw==
|
24
|
+
-----END CERTIFICATE-----
|
data/ext/sha3/extconf.rb
CHANGED
@@ -3,24 +3,18 @@ require 'rbconfig'
|
|
3
3
|
|
4
4
|
target_cpu = RbConfig::CONFIG['target_cpu']
|
5
5
|
|
6
|
-
if 1.size ==
|
7
|
-
Logging
|
8
|
-
FileUtils.cp Dir["#{$srcdir}/Reference/*"].collect { |f| File.expand_path(f) }, "#{$srcdir}/"
|
9
|
-
elsif 1.size == 8 and target_cpu =~ /i686|x86_64/
|
10
|
-
Logging::message "=== Using optimized (64-bit) ===\n"
|
6
|
+
if 1.size == 8 and target_cpu =~ /i686|x86_64/
|
7
|
+
Logging.message "=== Using optimized (64-bit) ===\n"
|
11
8
|
FileUtils.cp Dir["#{$srcdir}/Optimized64/*"].collect { |f| File.expand_path(f) }, "#{$srcdir}/"
|
12
9
|
else
|
13
|
-
Logging
|
10
|
+
Logging.message "=== Using reference ===\n"
|
14
11
|
FileUtils.cp Dir["#{$srcdir}/Reference/*"].collect { |f| File.expand_path(f) }, "#{$srcdir}/"
|
15
12
|
end
|
16
13
|
|
17
|
-
find_header(
|
18
|
-
find_header(
|
19
|
-
|
20
|
-
$CFLAGS = ' -fomit-frame-pointer -O3 -g0'
|
14
|
+
find_header('sha3.h')
|
15
|
+
find_header('digest.h')
|
21
16
|
|
22
|
-
|
23
|
-
|
24
|
-
end
|
17
|
+
$CFLAGS += ' -fomit-frame-pointer -O3 -g0 -fms-extensions '
|
18
|
+
$CFLAGS += ' -march=native ' if enable_config('march-tune-native', false)
|
25
19
|
|
26
20
|
create_makefile 'sha3_n'
|
data/lib/sha3/doc.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'digest'
|
2
4
|
|
3
5
|
module SHA3
|
@@ -99,8 +101,7 @@ module SHA3
|
|
99
101
|
# @example
|
100
102
|
# SHA3::Digest.hexdigest(256, 'compute me, please')
|
101
103
|
# SHA3::Digest::SHA256.hexdigest('compute me, please') # => Alternate syntax
|
102
|
-
def self.hexdigest(type, data)
|
103
|
-
end
|
104
|
+
def self.hexdigest(type, data); end
|
104
105
|
|
105
106
|
# Returns computed hash value for given hash type, and data in bytes.
|
106
107
|
#
|
@@ -112,8 +113,7 @@ module SHA3
|
|
112
113
|
# @example
|
113
114
|
# SHA3::Digest.digest(256, 'compute me, please')
|
114
115
|
# SHA3::Digest::SHA256.digest('compute me, please') # => Alternate syntax
|
115
|
-
def self.digest(type, data)
|
116
|
-
end
|
116
|
+
def self.digest(type, data); end
|
117
117
|
end
|
118
118
|
|
119
119
|
class DigestError < StandardError
|
data/lib/sha3/version.rb
CHANGED
data/lib/sha3.rb
CHANGED
@@ -1,35 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'sha3_n'
|
2
4
|
require 'sha3/version'
|
3
5
|
|
4
6
|
module SHA3
|
5
7
|
class Digest
|
6
|
-
|
7
8
|
# Based on 'OpenSSL for Ruby 2' project
|
8
9
|
# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
9
|
-
alg = { :
|
10
|
+
alg = { sha224: 'SHA224', sha256: 'SHA256', sha384: 'SHA384', sha512: 'SHA512' }
|
10
11
|
|
11
12
|
def self.digest(name, data)
|
12
13
|
super(data, name)
|
13
14
|
end
|
14
15
|
|
15
|
-
alg.each
|
16
|
-
klass = Class.new(Digest)
|
17
|
-
define_method(:initialize)
|
16
|
+
alg.each do |key, name|
|
17
|
+
klass = Class.new(Digest) do
|
18
|
+
define_method(:initialize) do |*data|
|
18
19
|
if data.length > 1
|
19
20
|
raise ArgumentError,
|
20
|
-
|
21
|
+
"wrong number of arguments (#{data.length} for 1)"
|
21
22
|
end
|
22
23
|
|
23
24
|
super(key, data.first)
|
24
|
-
|
25
|
-
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
26
28
|
singleton = (class << klass; self; end)
|
27
|
-
singleton.class_eval
|
28
|
-
define_method(:digest){ |data| Digest.digest(key, data) }
|
29
|
-
define_method(:hexdigest){ |data| Digest.hexdigest(key, data) }
|
30
|
-
|
29
|
+
singleton.class_eval do
|
30
|
+
define_method(:digest) { |data| Digest.digest(key, data) }
|
31
|
+
define_method(:hexdigest) { |data| Digest.hexdigest(key, data) }
|
32
|
+
end
|
31
33
|
|
32
34
|
const_set(name, klass)
|
33
|
-
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
data/sha3.gemspec
CHANGED
@@ -1,23 +1,53 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/sha3/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'sha3'
|
7
|
+
spec.version = SHA3::VERSION
|
8
|
+
|
9
|
+
spec.authors = ['Johanns Gregorian']
|
10
|
+
spec.email = ['io+sha3@jsg.io']
|
11
|
+
|
12
|
+
spec.description = 'SHA3 for Ruby is a native (C) FIPS 202 compliant implementation of SHA3 (Keccak) cryptographic hashing algorithm.'
|
13
|
+
spec.summary = 'SHA3 (FIPS 202) cryptographic hashing algorithm'
|
14
|
+
|
15
|
+
spec.homepage = 'https://github.com/johanns/sha3'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
spec.required_ruby_version = '>= 2.6.0'
|
18
|
+
|
19
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/CHANGELOG.md"
|
20
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
21
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
spec.bindir = 'exe'
|
32
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
|
+
spec.extensions = ['ext/sha3/extconf.rb']
|
34
|
+
spec.require_paths = ['lib']
|
35
|
+
|
36
|
+
# Uncomment to register a new dependency of your gem
|
37
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
38
|
+
|
39
|
+
# For more information and examples about making a new gem, check out our
|
40
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
41
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
42
|
+
|
43
|
+
spec.add_development_dependency('bundler', '~> 2.3')
|
44
|
+
spec.add_development_dependency('rake', '~> 13.0')
|
45
|
+
spec.add_development_dependency('rake-compiler', '~> 1.1')
|
46
|
+
spec.add_development_dependency('rspec', '~> 3.11')
|
47
|
+
spec.add_development_dependency('rubocop', '~> 1.25')
|
48
|
+
spec.add_development_dependency('rubocop-rake', '~> 0.6')
|
49
|
+
spec.add_development_dependency('rubocop-rspec', '~> 2.9')
|
50
|
+
|
51
|
+
spec.cert_chain = ['certs/johanns.pem']
|
52
|
+
spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME =~ /gem\z/
|
23
53
|
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,15 +1,68 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sha3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johanns Gregorian
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
10
|
-
cert_chain:
|
11
|
-
|
9
|
+
bindir: exe
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEFDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9pby9E
|
14
|
+
Qz1qc2cvREM9aW8wHhcNMjIwMzA5MDcyODEwWhcNMjMwMzA5MDcyODEwWjAaMRgw
|
15
|
+
FgYDVQQDDA9pby9EQz1qc2cvREM9aW8wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw
|
16
|
+
ggGKAoIBgQCuPwkDs4uoBV6pQhKp3uA58LkDPRR7VoI4QryuH7PbIwuO3xbuyR6T
|
17
|
+
xEqwcb9GgVnMxiFyXeVkWiriuGXqZ26Pp5zH/xxQNgPGCIyXuXeJMpASkWjJ9J6h
|
18
|
+
+jOdaG5jdL6zRcw/5XaJSQTLGO32BNOIezUZCF9JtMoEBQYHRWFjoD5BryjYnU3f
|
19
|
+
SstXg9nD8KOyk5Vzqk/wvJs5X+b2jcZL0KmSP1UgaCakfTCKf8LA9I5zAbvv2M9n
|
20
|
+
F0JQfKw4AUlmykzmOMEsITVxtM8lIVxm99KAS+lFn19xEjOs7nr3GktyLJxav8qI
|
21
|
+
3yXW/q5wUbOFrj/e1tk6r/W3bM6TQzGFBsBJgXEoFFZ+OQdEW8PXU0H5CIg59SxB
|
22
|
+
lXwSC1rKlxSeGNcKDXeIN1AU3pqv/PJj2SKg2+uQ9Staya0Mtek/caPDVfIy8AgH
|
23
|
+
ulTeTVN7m5SdVjVBl3rIehH/j0R/JF7ygsMkJEQAxrwPxqmazXkPAGLNNIqppaxi
|
24
|
+
VyHhxSnGefUCAwEAAaNlMGMwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
25
|
+
BBYEFBZFuuJYra4ctzMvtfzlTq3pW4idMBQGA1UdEQQNMAuBCWlvQGpzZy5pbzAU
|
26
|
+
BgNVHRIEDTALgQlpb0Bqc2cuaW8wDQYJKoZIhvcNAQELBQADggGBAF2jXh+4LzPg
|
27
|
+
Mj8gTCVTxj4/OhQ303cS5gasgh+R9Zxcf1cfTXOxEeIXdrqJiMhILWVWgCYZxagL
|
28
|
+
B5pU6MOyIOi4XAm5RMO3mIyTrY05Q/JbQ5j2ccuIOlL+XvhjAYKZmt9BkJLKfLEp
|
29
|
+
hagXHZe40Hd3qwkgJ3ug3T28gkBWaTq8FSbTOfCVX9uNjQrukAP/VrfnKZiNnpJ7
|
30
|
+
FOtEKDk3l9JWCyX8LQwfljPmQhvFHYnMRyt0l2b0I5li6MWUE4JmrbtK8/Fyo0I0
|
31
|
+
PChRryVpy0HnKvqoKQyqeMspLbbKCsO1PRS5VFZ/ybrPy63paFPdikeKMZIH3oJQ
|
32
|
+
wePRJFEp3gdQZcSjfkzC38QFh9JuKFJFMC4Y3e5uVeeydEGGUekH1s/B5/EuBCRi
|
33
|
+
vaoldWA6C6e/X/XQsMNdC04+d7IdgNRf8NkN/atZdJLcFVcaXGS9MncPZnwBC2GD
|
34
|
+
GBMFs3s6mx0HRpclYTMXK71jLsfqtM2SriIbx1VqiuUMUtddNrGcOw==
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2022-03-09 00:00:00.000000000 Z
|
12
37
|
dependencies:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: bundler
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '2.3'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '2.3'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rake
|
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'
|
13
66
|
- !ruby/object:Gem::Dependency
|
14
67
|
name: rake-compiler
|
15
68
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,61 +83,75 @@ dependencies:
|
|
30
83
|
requirements:
|
31
84
|
- - "~>"
|
32
85
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
86
|
+
version: '3.11'
|
34
87
|
type: :development
|
35
88
|
prerelease: false
|
36
89
|
version_requirements: !ruby/object:Gem::Requirement
|
37
90
|
requirements:
|
38
91
|
- - "~>"
|
39
92
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
93
|
+
version: '3.11'
|
41
94
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
95
|
+
name: rubocop
|
43
96
|
requirement: !ruby/object:Gem::Requirement
|
44
97
|
requirements:
|
45
98
|
- - "~>"
|
46
99
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
100
|
+
version: '1.25'
|
48
101
|
type: :development
|
49
102
|
prerelease: false
|
50
103
|
version_requirements: !ruby/object:Gem::Requirement
|
51
104
|
requirements:
|
52
105
|
- - "~>"
|
53
106
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
107
|
+
version: '1.25'
|
55
108
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
109
|
+
name: rubocop-rake
|
57
110
|
requirement: !ruby/object:Gem::Requirement
|
58
111
|
requirements:
|
59
112
|
- - "~>"
|
60
113
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
114
|
+
version: '0.6'
|
62
115
|
type: :development
|
63
116
|
prerelease: false
|
64
117
|
version_requirements: !ruby/object:Gem::Requirement
|
65
118
|
requirements:
|
66
119
|
- - "~>"
|
67
120
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
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'
|
69
136
|
description: SHA3 for Ruby is a native (C) FIPS 202 compliant implementation of SHA3
|
70
137
|
(Keccak) cryptographic hashing algorithm.
|
71
|
-
email:
|
138
|
+
email:
|
139
|
+
- io+sha3@jsg.io
|
72
140
|
executables: []
|
73
141
|
extensions:
|
74
142
|
- ext/sha3/extconf.rb
|
75
143
|
extra_rdoc_files: []
|
76
144
|
files:
|
77
145
|
- ".document"
|
78
|
-
- ".gitignore"
|
79
146
|
- ".rspec"
|
80
|
-
- ".
|
147
|
+
- ".rubocop.yml"
|
81
148
|
- ".yardopts"
|
82
149
|
- ChangeLog.rdoc
|
83
150
|
- Gemfile
|
84
|
-
- Gemfile.ci
|
85
151
|
- LICENSE.txt
|
86
152
|
- README.md
|
87
153
|
- Rakefile
|
154
|
+
- certs/johanns.pem
|
88
155
|
- ext/sha3/KeccakF-1600-interface.h
|
89
156
|
- ext/sha3/KeccakHash.c
|
90
157
|
- ext/sha3/KeccakHash.h
|
@@ -113,14 +180,15 @@ files:
|
|
113
180
|
- lib/sha3/doc.rb
|
114
181
|
- lib/sha3/version.rb
|
115
182
|
- sha3.gemspec
|
116
|
-
- spec/generate_tests.rb
|
117
|
-
- spec/sha3_core_spec.rb
|
118
|
-
- spec/spec_helper.rb
|
119
183
|
- tests.sh
|
120
|
-
homepage: https://github.com/johanns/sha3
|
184
|
+
homepage: https://github.com/johanns/sha3
|
121
185
|
licenses:
|
122
186
|
- MIT
|
123
|
-
metadata:
|
187
|
+
metadata:
|
188
|
+
changelog_uri: https://github.com/johanns/sha3/CHANGELOG.md
|
189
|
+
homepage_uri: https://github.com/johanns/sha3
|
190
|
+
source_code_uri: https://github.com/johanns/sha3
|
191
|
+
rubygems_mfa_required: 'true'
|
124
192
|
post_install_message:
|
125
193
|
rdoc_options: []
|
126
194
|
require_paths:
|
@@ -129,18 +197,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
197
|
requirements:
|
130
198
|
- - ">="
|
131
199
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
200
|
+
version: 2.6.0
|
133
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
202
|
requirements:
|
135
203
|
- - ">="
|
136
204
|
- !ruby/object:Gem::Version
|
137
205
|
version: '0'
|
138
206
|
requirements: []
|
139
|
-
rubygems_version: 3.2.
|
207
|
+
rubygems_version: 3.2.32
|
140
208
|
signing_key:
|
141
209
|
specification_version: 4
|
142
|
-
summary: SHA3
|
143
|
-
test_files:
|
144
|
-
- spec/generate_tests.rb
|
145
|
-
- spec/sha3_core_spec.rb
|
146
|
-
- spec/spec_helper.rb
|
210
|
+
summary: SHA3 (FIPS 202) cryptographic hashing algorithm
|
211
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|
data/.gitignore
DELETED
@@ -1,234 +0,0 @@
|
|
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 ###
|
163
|
-
*.gem
|
164
|
-
*.rbc
|
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
DELETED
data/Gemfile.ci
DELETED
data/spec/generate_tests.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# Based on python-sha3's / digest-sha3 test generator.
|
2
|
-
|
3
|
-
FILES = [
|
4
|
-
['data/ShortMsgKAT_SHA3-224.txt', 224],
|
5
|
-
['data/ShortMsgKAT_SHA3-256.txt', 256],
|
6
|
-
['data/ShortMsgKAT_SHA3-384.txt', 384],
|
7
|
-
['data/ShortMsgKAT_SHA3-512.txt', 512]
|
8
|
-
].freeze
|
9
|
-
|
10
|
-
def gen_digest_byte_tests
|
11
|
-
FILES.each do |path, hashlen|
|
12
|
-
name = File.basename(path).split('.')[0]
|
13
|
-
|
14
|
-
f = File.new("sha3_digest_#{name}_spec.rb", 'w')
|
15
|
-
f.puts(
|
16
|
-
%{require 'spec_helper'
|
17
|
-
require 'sha3'
|
18
|
-
|
19
|
-
describe "SHA3::Digest.new(#{hashlen})" do
|
20
|
-
it "should match byte-length test vectors (#{name})." do
|
21
|
-
}
|
22
|
-
)
|
23
|
-
contents = File.read(path).split('Len = ')
|
24
|
-
contents.each do |test|
|
25
|
-
lines = test.split("\n")
|
26
|
-
next unless !lines.empty? && lines[0] !~ /^#/
|
27
|
-
|
28
|
-
length = lines[0].to_i
|
29
|
-
next unless (length % 8).zero? && length != 0
|
30
|
-
|
31
|
-
msg_raw = [lines[1].split(' = ').last].pack('H*')
|
32
|
-
md = lines[2].split(' = ').last.downcase
|
33
|
-
f.puts(
|
34
|
-
%{ expect(SHA3::Digest.new(#{hashlen}, #{msg_raw.inspect}).hexdigest).to eq("#{md}")
|
35
|
-
}
|
36
|
-
)
|
37
|
-
end
|
38
|
-
f.puts(
|
39
|
-
%( end
|
40
|
-
end
|
41
|
-
)
|
42
|
-
)
|
43
|
-
f.close
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def setup; end
|
48
|
-
|
49
|
-
gen_digest_byte_tests
|
data/spec/sha3_core_spec.rb
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'sha3'
|
3
|
-
|
4
|
-
RSpec.describe SHA3 do
|
5
|
-
it 'should have a VERSION constant' do
|
6
|
-
expect(subject.const_get('VERSION')).not_to be_empty
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should have a KECCAK_VERSION constant' do
|
10
|
-
expect(subject.const_get('KECCAK_VERSION')).not_to be_empty
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should have Digest class' do
|
14
|
-
expect(subject.const_get('Digest').is_a?(Class)).to be_truthy
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
RSpec.describe SHA3::Digest do
|
19
|
-
it 'should pass Digest.new() (default: :sha256) usage test' do
|
20
|
-
sha = SHA3::Digest.new()
|
21
|
-
|
22
|
-
expect(sha.hexdigest).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
23
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('677035391cd3701293d385f037ba32796252bb7ce180b00b582dd9b20aaad7f0')
|
24
|
-
expect(sha.reset).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
25
|
-
|
26
|
-
sha << (['6172f1971a6e1e4e6170afbad95d5fec99bf69b24b674bc17dd78011615e502de6f56b86b1a71d3f4348087218ac7b7d09302993be272e4a591968aef18a1262d665610d1070ee91cc8da36e1f841a69a7a682c580e836941d21d909a3afc1f0b963e1ca5ab193e124a1a53df1c587470e5881fb54dae1b0d840f0c8f9d1b04c645ba1041c7d8dbf22030a623aa15638b3d99a2c400ff76f3252079af88d2b37f35ee66c1ad7801a28d3d388ac450b97d5f0f79e4541755356b3b1a5696b023f39ab7ab5f28df4202936bc97393b93bc915cb159ea1bd7a0a414cb4b7a1ac3af68f50d79f0c9c7314e750f7d02faa58bfa'].pack('H*'))
|
27
|
-
|
28
|
-
expect(sha.hexdigest).to eq('f60c53ba2132293b881f0513e7ab47fe9746ed4a6ac9cade61e6d802d5872372')
|
29
|
-
expect(sha.digest_length).to eq(32)
|
30
|
-
expect(sha.block_length).to eq(136)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should pass Digest.new(:sha224) usage test' do
|
34
|
-
sha = SHA3::Digest.new(:sha224)
|
35
|
-
|
36
|
-
expect(sha.hexdigest).to eq('6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')
|
37
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('df70adc49b2e76eee3a6931b93fa41841c3af2cdf5b32a18b5478c39')
|
38
|
-
expect(sha.reset).to eq('6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')
|
39
|
-
|
40
|
-
sha << (['5fce8109a358570e40983e1184e541833bb9091e280f258cfb144387b05d190e431cb19baa67273ba0c58abe91308e1844dcd0b3678baa42f335f2fa05267a0240b3c718a5942b3b3e3bfa98a55c25a1466e8d7a603722cb2bbf03afa54cd769a99f310735ee5a05dae2c22d397bd95635f58c48a67f90e1b73aafcd3f82117f0166657838691005b18da6f341d6e90fc1cdb352b30fae45d348294e501b63252de14740f2b85ae5299ddec3172de8b6d0ba219a20a23bb5e10ff434d39db3f583305e9f5c039d98569e377b75a70ab837d1df269b8a4b566f40bb91b577455fd3c356c914fa06b9a7ce24c7317a172d'].pack('H*'))
|
41
|
-
|
42
|
-
expect(sha.hexdigest).to eq('2ebe13f12ec43e3f6b0506d7ab216e1c311394f7c89d69a920cd00c0')
|
43
|
-
expect(sha.digest_length).to eq(28)
|
44
|
-
expect(sha.block_length).to eq(144)
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'should pass Digest.new(:sha256) usage test' do
|
48
|
-
sha = SHA3::Digest.new(:sha256)
|
49
|
-
|
50
|
-
expect(sha.hexdigest).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
51
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('677035391cd3701293d385f037ba32796252bb7ce180b00b582dd9b20aaad7f0')
|
52
|
-
expect(sha.reset).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
53
|
-
|
54
|
-
sha << (['6172f1971a6e1e4e6170afbad95d5fec99bf69b24b674bc17dd78011615e502de6f56b86b1a71d3f4348087218ac7b7d09302993be272e4a591968aef18a1262d665610d1070ee91cc8da36e1f841a69a7a682c580e836941d21d909a3afc1f0b963e1ca5ab193e124a1a53df1c587470e5881fb54dae1b0d840f0c8f9d1b04c645ba1041c7d8dbf22030a623aa15638b3d99a2c400ff76f3252079af88d2b37f35ee66c1ad7801a28d3d388ac450b97d5f0f79e4541755356b3b1a5696b023f39ab7ab5f28df4202936bc97393b93bc915cb159ea1bd7a0a414cb4b7a1ac3af68f50d79f0c9c7314e750f7d02faa58bfa'].pack('H*'))
|
55
|
-
|
56
|
-
expect(sha.hexdigest).to eq('f60c53ba2132293b881f0513e7ab47fe9746ed4a6ac9cade61e6d802d5872372')
|
57
|
-
expect(sha.digest_length).to eq(32)
|
58
|
-
expect(sha.block_length).to eq(136)
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'should pass Digest.new(:sha384) usage test' do
|
62
|
-
sha = SHA3::Digest.new(:sha384)
|
63
|
-
|
64
|
-
expect(sha.hexdigest).to eq('0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004')
|
65
|
-
|
66
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('5ee7f374973cd4bb3dc41e3081346798497ff6e36cb9352281dfe07d07fc530ca9ad8ef7aad56ef5d41be83d5e543807')
|
67
|
-
expect(sha.reset).to eq('0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004')
|
68
|
-
|
69
|
-
sha << (['3b8e97c5ffc2d6a40fa7de7fcefc90f3b12c940e7ab415321e29ee692dfac799b009c99dcddb708fce5a178c5c35ee2b8617143edc4c40b4d313661f49abdd93cea79d117518805496fe6acf292c4c2a1f76b403a97d7c399daf85b46ad84e16246c67d6836757bde336c290d5d401e6c1386ab32797af6bb251e9b2d8fe754c47482b72e0b394eab76916126fd68ea7d65eb93d59f5b4c5ac40f7c3b37e7f3694f29424c24af8c8f0ef59cd9dbf1d28e0e10f799a6f78cad1d45b9db3d7dee4a7059abe99182714983b9c9d44d7f5643596d4f3'].pack('H*'))
|
70
|
-
|
71
|
-
expect(sha.hexdigest).to eq('9b809198dcce24175e33098331d3a402a821ae9326e72775aae34d1a9bb53d2b57863905cfd60543bbc42b454007c315')
|
72
|
-
expect(sha.digest_length).to eq(48)
|
73
|
-
expect(sha.block_length).to eq(104)
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'should pass Digest.new(:sha512) usage test' do
|
77
|
-
sha = SHA3::Digest.new(:sha512)
|
78
|
-
|
79
|
-
expect(sha.hexdigest).to eq('a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')
|
80
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('3939fcc8b57b63612542da31a834e5dcc36e2ee0f652ac72e02624fa2e5adeecc7dd6bb3580224b4d6138706fc6e80597b528051230b00621cc2b22999eaa205')
|
81
|
-
expect(sha.reset).to eq('a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')
|
82
|
-
|
83
|
-
sha << (['03d625488354df30e3f875a68edfcf340e8366a8e1ab67f9d5c5486a96829dfac0578289082b2a62117e1cf418b43b90e0adc881fc6ae8105c888e9ecd21aea1c9ae1a4038dfd17378fed71d02ae492087d7cdcd98f746855227967cb1ab4714261ee3bead3f4db118329d3ebef4bc48a875c19ba763966da0ebea800e01b2f50b00e9dd4caca6dcb314d00184ef71ea2391d760c950710db4a70f9212ffc54861f9dc752ce18867b8ad0c48df8466ef7231e7ac567f0eb55099e622ebb86cb237520190a61c66ad34f1f4e289cb3282ae3eaac6152ed24d2c92bae5a7658252a53c49b7b02dfe54fdb2e90074b6cf310ac661'].pack('H*'))
|
84
|
-
|
85
|
-
expect(sha.hexdigest).to eq('1fcd1e38ab03c750366cf86dd72ec3bf22f5bbf7fea0149d31b6a67b68b537b59ba37917fd88ced9aa8d2941a65f552b7928b3785c66d640f3b74af039ed18ce')
|
86
|
-
expect(sha.digest_length).to eq(64)
|
87
|
-
expect(sha.block_length).to eq(72)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
RSpec.describe 'SHA3::Digest::SHAxyz' do
|
92
|
-
it 'should pass Digest.SHA224() usage test' do
|
93
|
-
sha = SHA3::Digest::SHA224.new()
|
94
|
-
|
95
|
-
expect(sha.hexdigest).to eq('6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')
|
96
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('df70adc49b2e76eee3a6931b93fa41841c3af2cdf5b32a18b5478c39')
|
97
|
-
expect(sha.reset).to eq('6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')
|
98
|
-
|
99
|
-
sha << (['5fce8109a358570e40983e1184e541833bb9091e280f258cfb144387b05d190e431cb19baa67273ba0c58abe91308e1844dcd0b3678baa42f335f2fa05267a0240b3c718a5942b3b3e3bfa98a55c25a1466e8d7a603722cb2bbf03afa54cd769a99f310735ee5a05dae2c22d397bd95635f58c48a67f90e1b73aafcd3f82117f0166657838691005b18da6f341d6e90fc1cdb352b30fae45d348294e501b63252de14740f2b85ae5299ddec3172de8b6d0ba219a20a23bb5e10ff434d39db3f583305e9f5c039d98569e377b75a70ab837d1df269b8a4b566f40bb91b577455fd3c356c914fa06b9a7ce24c7317a172d'].pack("H*"))
|
100
|
-
|
101
|
-
expect(sha.hexdigest).to eq('2ebe13f12ec43e3f6b0506d7ab216e1c311394f7c89d69a920cd00c0')
|
102
|
-
expect(sha.digest_length).to eq(28)
|
103
|
-
expect(sha.block_length).to eq(144)
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'should pass Digest.SHA256() usage test' do
|
107
|
-
sha = SHA3::Digest::SHA256.new()
|
108
|
-
|
109
|
-
expect(sha.hexdigest).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
110
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('677035391cd3701293d385f037ba32796252bb7ce180b00b582dd9b20aaad7f0')
|
111
|
-
expect(sha.reset).to eq('a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')
|
112
|
-
|
113
|
-
sha << (['6172f1971a6e1e4e6170afbad95d5fec99bf69b24b674bc17dd78011615e502de6f56b86b1a71d3f4348087218ac7b7d09302993be272e4a591968aef18a1262d665610d1070ee91cc8da36e1f841a69a7a682c580e836941d21d909a3afc1f0b963e1ca5ab193e124a1a53df1c587470e5881fb54dae1b0d840f0c8f9d1b04c645ba1041c7d8dbf22030a623aa15638b3d99a2c400ff76f3252079af88d2b37f35ee66c1ad7801a28d3d388ac450b97d5f0f79e4541755356b3b1a5696b023f39ab7ab5f28df4202936bc97393b93bc915cb159ea1bd7a0a414cb4b7a1ac3af68f50d79f0c9c7314e750f7d02faa58bfa'].pack("H*"))
|
114
|
-
|
115
|
-
expect(sha.hexdigest).to eq('f60c53ba2132293b881f0513e7ab47fe9746ed4a6ac9cade61e6d802d5872372')
|
116
|
-
expect(sha.digest_length).to eq(32)
|
117
|
-
expect(sha.block_length).to eq(136)
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'should pass Digest.SHA384() usage test' do
|
121
|
-
sha = SHA3::Digest::SHA384.new()
|
122
|
-
|
123
|
-
expect(sha.hexdigest).to eq('0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004')
|
124
|
-
|
125
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('5ee7f374973cd4bb3dc41e3081346798497ff6e36cb9352281dfe07d07fc530ca9ad8ef7aad56ef5d41be83d5e543807')
|
126
|
-
expect(sha.reset).to eq('0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004')
|
127
|
-
|
128
|
-
sha << (['3b8e97c5ffc2d6a40fa7de7fcefc90f3b12c940e7ab415321e29ee692dfac799b009c99dcddb708fce5a178c5c35ee2b8617143edc4c40b4d313661f49abdd93cea79d117518805496fe6acf292c4c2a1f76b403a97d7c399daf85b46ad84e16246c67d6836757bde336c290d5d401e6c1386ab32797af6bb251e9b2d8fe754c47482b72e0b394eab76916126fd68ea7d65eb93d59f5b4c5ac40f7c3b37e7f3694f29424c24af8c8f0ef59cd9dbf1d28e0e10f799a6f78cad1d45b9db3d7dee4a7059abe99182714983b9c9d44d7f5643596d4f3'].pack("H*"))
|
129
|
-
|
130
|
-
expect(sha.hexdigest).to eq('9b809198dcce24175e33098331d3a402a821ae9326e72775aae34d1a9bb53d2b57863905cfd60543bbc42b454007c315')
|
131
|
-
expect(sha.digest_length).to eq(48)
|
132
|
-
expect(sha.block_length).to eq(104)
|
133
|
-
end
|
134
|
-
|
135
|
-
it 'should pass Digest.SHA512() usage test' do
|
136
|
-
sha = SHA3::Digest::SHA512.new()
|
137
|
-
|
138
|
-
expect(sha.hexdigest).to eq('a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')
|
139
|
-
expect(sha.update(['cc'].pack('H*'))).to eq('3939fcc8b57b63612542da31a834e5dcc36e2ee0f652ac72e02624fa2e5adeecc7dd6bb3580224b4d6138706fc6e80597b528051230b00621cc2b22999eaa205')
|
140
|
-
expect(sha.reset).to eq('a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')
|
141
|
-
|
142
|
-
sha << (['03d625488354df30e3f875a68edfcf340e8366a8e1ab67f9d5c5486a96829dfac0578289082b2a62117e1cf418b43b90e0adc881fc6ae8105c888e9ecd21aea1c9ae1a4038dfd17378fed71d02ae492087d7cdcd98f746855227967cb1ab4714261ee3bead3f4db118329d3ebef4bc48a875c19ba763966da0ebea800e01b2f50b00e9dd4caca6dcb314d00184ef71ea2391d760c950710db4a70f9212ffc54861f9dc752ce18867b8ad0c48df8466ef7231e7ac567f0eb55099e622ebb86cb237520190a61c66ad34f1f4e289cb3282ae3eaac6152ed24d2c92bae5a7658252a53c49b7b02dfe54fdb2e90074b6cf310ac661'].pack("H*"))
|
143
|
-
|
144
|
-
expect(sha.hexdigest).to eq('1fcd1e38ab03c750366cf86dd72ec3bf22f5bbf7fea0149d31b6a67b68b537b59ba37917fd88ced9aa8d2941a65f552b7928b3785c66d640f3b74af039ed18ce')
|
145
|
-
expect(sha.digest_length).to eq(64)
|
146
|
-
expect(sha.block_length).to eq(72)
|
147
|
-
end
|
148
|
-
end
|
data/spec/spec_helper.rb
DELETED