digest 3.0.0 → 3.1.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
- data/ext/digest/bubblebabble/extconf.rb +0 -2
- data/ext/digest/extconf.rb +1 -1
- data/ext/digest/lib/digest/loader.rb +3 -0
- data/ext/digest/lib/digest/sha2/loader.rb +3 -0
- data/ext/digest/md5/extconf.rb +0 -2
- data/ext/digest/md5/md5.c +1 -1
- data/ext/digest/rmd160/extconf.rb +3 -1
- data/ext/digest/sha1/extconf.rb +0 -2
- data/ext/digest/sha2/extconf.rb +0 -2
- data/ext/digest/sha2/sha2.c +7 -7
- data/{ext/digest/sha2/lib → lib/digest}/sha2.rb +1 -1
- data/lib/digest/version.rb +5 -0
- data/lib/digest.rb +16 -2
- metadata +13 -58
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/digest.gemspec +0 -47
- data/ext/openssl/deprecation.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7207f387ca787774225cd9df57fae5c62761095cbe5976d3b0e92844ce700add
|
4
|
+
data.tar.gz: 7c5bdbbac47aa05a44bc9bc37a4519a4eb7c062dfc781dd8b4c6b567a6596aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b589e6eb9462f1e9572ba5186840437f85bf6c5c7a12665ef3b6b6d0848a2e372f1df9b228a49b6e5321ca280353cf5de652ad5404af5cc200c4fe301ce37760
|
7
|
+
data.tar.gz: 40f9583406b3f58ff6f22c8af4a2a414db6753b472201d22471eca5df1c16ca5563ca56700357a3165250505697a9fa58e6f73da7c0baf8ea56a5e12589aff3e
|
data/ext/digest/extconf.rb
CHANGED
data/ext/digest/md5/extconf.rb
CHANGED
data/ext/digest/md5/md5.c
CHANGED
@@ -225,7 +225,7 @@ md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/)
|
|
225
225
|
uint32_t xbuf[16];
|
226
226
|
const uint32_t *X;
|
227
227
|
|
228
|
-
if (!((
|
228
|
+
if (!(((uintptr_t)data) & 3)) {
|
229
229
|
/* data are properly aligned */
|
230
230
|
X = (const uint32_t *)data;
|
231
231
|
} else {
|
@@ -6,7 +6,9 @@
|
|
6
6
|
require "mkmf"
|
7
7
|
require File.expand_path("../../digest_conf", __FILE__)
|
8
8
|
|
9
|
-
|
9
|
+
if try_static_assert("RUBY_API_VERSION_MAJOR < 3", "ruby/version.h")
|
10
|
+
$defs << "-DNDEBUG"
|
11
|
+
end
|
10
12
|
|
11
13
|
$objs = [ "rmd160init.#{$OBJEXT}" ]
|
12
14
|
|
data/ext/digest/sha1/extconf.rb
CHANGED
data/ext/digest/sha2/extconf.rb
CHANGED
data/ext/digest/sha2/sha2.c
CHANGED
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
/*
|
96
96
|
* Define the followingsha2_* types to types of the correct length on
|
97
|
-
* the native
|
97
|
+
* the native architecture. Most BSD systems and Linux define u_intXX_t
|
98
98
|
* types. Machines with very recent ANSI C headers, can use the
|
99
99
|
* uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H
|
100
100
|
* during compile or in the sha.h header file.
|
@@ -575,7 +575,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
|
|
575
575
|
usedspace = freespace = 0;
|
576
576
|
}
|
577
577
|
|
578
|
-
int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
|
578
|
+
int SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) {
|
579
579
|
sha2_word32 *d = (sha2_word32*)digest;
|
580
580
|
unsigned int usedspace;
|
581
581
|
|
@@ -640,7 +640,7 @@ int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
|
|
640
640
|
return 1;
|
641
641
|
}
|
642
642
|
|
643
|
-
char *SHA256_End(SHA256_CTX* context, char buffer[]) {
|
643
|
+
char *SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) {
|
644
644
|
sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest;
|
645
645
|
int i;
|
646
646
|
|
@@ -943,7 +943,7 @@ void SHA512_Last(SHA512_CTX* context) {
|
|
943
943
|
SHA512_Transform(context, (sha2_word64*)context->buffer);
|
944
944
|
}
|
945
945
|
|
946
|
-
int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
|
946
|
+
int SHA512_Final(sha2_byte digest[SHA512_DIGEST_LENGTH], SHA512_CTX* context) {
|
947
947
|
sha2_word64 *d = (sha2_word64*)digest;
|
948
948
|
|
949
949
|
/* Sanity check: */
|
@@ -973,7 +973,7 @@ int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
|
|
973
973
|
return 1;
|
974
974
|
}
|
975
975
|
|
976
|
-
char *SHA512_End(SHA512_CTX* context, char buffer[]) {
|
976
|
+
char *SHA512_End(SHA512_CTX* context, char buffer[SHA512_DIGEST_STRING_LENGTH]) {
|
977
977
|
sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest;
|
978
978
|
int i;
|
979
979
|
|
@@ -1019,7 +1019,7 @@ void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) {
|
|
1019
1019
|
SHA512_Update((SHA512_CTX*)context, data, len);
|
1020
1020
|
}
|
1021
1021
|
|
1022
|
-
int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
|
1022
|
+
int SHA384_Final(sha2_byte digest[SHA384_DIGEST_LENGTH], SHA384_CTX* context) {
|
1023
1023
|
sha2_word64 *d = (sha2_word64*)digest;
|
1024
1024
|
|
1025
1025
|
/* Sanity check: */
|
@@ -1049,7 +1049,7 @@ int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
|
|
1049
1049
|
return 1;
|
1050
1050
|
}
|
1051
1051
|
|
1052
|
-
char *SHA384_End(SHA384_CTX* context, char buffer[]) {
|
1052
|
+
char *SHA384_End(SHA384_CTX* context, char buffer[SHA384_DIGEST_STRING_LENGTH]) {
|
1053
1053
|
sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest;
|
1054
1054
|
int i;
|
1055
1055
|
|
data/lib/digest.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# frozen_string_literal: false
|
2
|
-
|
2
|
+
|
3
|
+
if defined?(Digest) &&
|
4
|
+
/\A(?:2\.|3\.0\.[0-2]\z)/.match?(RUBY_VERSION) &&
|
5
|
+
caller_locations.any? { |l|
|
6
|
+
%r{/(rubygems/gem_runner|bundler/cli)\.rb}.match?(l.path)
|
7
|
+
}
|
8
|
+
# Before Ruby 3.0.3/3.1.0, the gem and bundle commands used to load
|
9
|
+
# the digest library before loading additionally installed gems, so
|
10
|
+
# you will get constant redefinition warnings and unexpected
|
11
|
+
# implementation overwriting if we proceed here. Avoid that.
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'digest/version'
|
16
|
+
require 'digest/loader'
|
3
17
|
|
4
18
|
module Digest
|
5
19
|
# A mutex for Digest().
|
@@ -8,7 +22,7 @@ module Digest
|
|
8
22
|
def self.const_missing(name) # :nodoc:
|
9
23
|
case name
|
10
24
|
when :SHA256, :SHA384, :SHA512
|
11
|
-
lib = 'digest/sha2
|
25
|
+
lib = 'digest/sha2'
|
12
26
|
else
|
13
27
|
lib = File.join('digest', name.to_s.downcase)
|
14
28
|
end
|
metadata
CHANGED
@@ -1,77 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake-compiler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
11
|
+
date: 2021-12-24 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: Provides a framework for message digest libraries.
|
56
14
|
email:
|
57
15
|
- knu@idaemons.org
|
58
16
|
executables: []
|
59
17
|
extensions:
|
60
|
-
- ext/digest/extconf.rb
|
61
18
|
- ext/digest/bubblebabble/extconf.rb
|
19
|
+
- ext/digest/extconf.rb
|
62
20
|
- ext/digest/md5/extconf.rb
|
63
21
|
- ext/digest/rmd160/extconf.rb
|
64
22
|
- ext/digest/sha1/extconf.rb
|
65
23
|
- ext/digest/sha2/extconf.rb
|
66
24
|
extra_rdoc_files: []
|
67
25
|
files:
|
68
|
-
- Gemfile
|
69
26
|
- LICENSE.txt
|
70
27
|
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- bin/console
|
73
|
-
- bin/setup
|
74
|
-
- digest.gemspec
|
75
28
|
- ext/digest/bubblebabble/bubblebabble.c
|
76
29
|
- ext/digest/bubblebabble/extconf.rb
|
77
30
|
- ext/digest/defs.h
|
@@ -79,6 +32,8 @@ files:
|
|
79
32
|
- ext/digest/digest.h
|
80
33
|
- ext/digest/digest_conf.rb
|
81
34
|
- ext/digest/extconf.rb
|
35
|
+
- ext/digest/lib/digest/loader.rb
|
36
|
+
- ext/digest/lib/digest/sha2/loader.rb
|
82
37
|
- ext/digest/md5/extconf.rb
|
83
38
|
- ext/digest/md5/md5.c
|
84
39
|
- ext/digest/md5/md5.h
|
@@ -94,21 +49,21 @@ files:
|
|
94
49
|
- ext/digest/sha1/sha1cc.h
|
95
50
|
- ext/digest/sha1/sha1init.c
|
96
51
|
- ext/digest/sha2/extconf.rb
|
97
|
-
- ext/digest/sha2/lib/sha2.rb
|
98
52
|
- ext/digest/sha2/sha2.c
|
99
53
|
- ext/digest/sha2/sha2.h
|
100
54
|
- ext/digest/sha2/sha2cc.h
|
101
55
|
- ext/digest/sha2/sha2init.c
|
102
56
|
- ext/digest/test.sh
|
103
|
-
- ext/openssl/deprecation.rb
|
104
57
|
- lib/digest.rb
|
58
|
+
- lib/digest/sha2.rb
|
59
|
+
- lib/digest/version.rb
|
105
60
|
homepage: https://github.com/ruby/digest
|
106
61
|
licenses:
|
107
62
|
- Ruby
|
108
63
|
- BSD-2-Clause
|
109
64
|
metadata:
|
110
65
|
msys2_mingw_dependencies: openssl
|
111
|
-
post_install_message:
|
66
|
+
post_install_message:
|
112
67
|
rdoc_options: []
|
113
68
|
require_paths:
|
114
69
|
- lib
|
@@ -116,15 +71,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
71
|
requirements:
|
117
72
|
- - ">="
|
118
73
|
- !ruby/object:Gem::Version
|
119
|
-
version: 2.
|
74
|
+
version: 2.5.0
|
120
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
76
|
requirements:
|
122
77
|
- - ">="
|
123
78
|
- !ruby/object:Gem::Version
|
124
79
|
version: '0'
|
125
80
|
requirements: []
|
126
|
-
rubygems_version: 3.2.
|
127
|
-
signing_key:
|
81
|
+
rubygems_version: 3.2.32
|
82
|
+
signing_key:
|
128
83
|
specification_version: 4
|
129
84
|
summary: Provides a framework for message digest libraries.
|
130
85
|
test_files: []
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rake/testtask"
|
3
|
-
|
4
|
-
Rake::TestTask.new(:test) do |t|
|
5
|
-
ENV["RUBYOPT"] = "-Itest -Itest/lib -Ilib"
|
6
|
-
t.test_files = FileList["test/**/test_*.rb"]
|
7
|
-
end
|
8
|
-
|
9
|
-
require 'rake/extensiontask'
|
10
|
-
Rake::ExtensionTask.new("digest")
|
11
|
-
%w(bubblebabble md5 rmd160 sha1 sha2).each do |ext|
|
12
|
-
Rake::ExtensionTask.new("digest/#{ext}")
|
13
|
-
end
|
14
|
-
|
15
|
-
task :default => :test
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "digest"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/digest.gemspec
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "digest"
|
6
|
-
spec.version = "3.0.0"
|
7
|
-
spec.authors = ["Akinori MUSHA"]
|
8
|
-
spec.email = ["knu@idaemons.org"]
|
9
|
-
|
10
|
-
spec.summary = %q{Provides a framework for message digest libraries.}
|
11
|
-
spec.description = %q{Provides a framework for message digest libraries.}
|
12
|
-
spec.homepage = "https://github.com/ruby/digest"
|
13
|
-
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
14
|
-
|
15
|
-
spec.files = [
|
16
|
-
"Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "digest.gemspec",
|
17
|
-
"ext/digest/bubblebabble/bubblebabble.c", "ext/digest/bubblebabble/extconf.rb", "ext/digest/defs.h",
|
18
|
-
"ext/digest/digest.c", "ext/digest/digest.h", "ext/digest/digest_conf.rb", "ext/digest/extconf.rb",
|
19
|
-
"ext/digest/md5/extconf.rb", "ext/digest/md5/md5.c", "ext/digest/md5/md5.h", "ext/digest/md5/md5cc.h",
|
20
|
-
"ext/digest/md5/md5init.c", "ext/digest/rmd160/extconf.rb", "ext/digest/rmd160/rmd160.c",
|
21
|
-
"ext/digest/rmd160/rmd160.h", "ext/digest/rmd160/rmd160init.c", "ext/digest/sha1/extconf.rb",
|
22
|
-
"ext/digest/sha1/sha1.c", "ext/digest/sha1/sha1.h", "ext/digest/sha1/sha1cc.h",
|
23
|
-
"ext/digest/sha1/sha1init.c", "ext/digest/sha2/extconf.rb", "ext/digest/sha2/lib/sha2.rb",
|
24
|
-
"ext/digest/sha2/sha2.c", "ext/digest/sha2/sha2.h", "ext/digest/sha2/sha2cc.h",
|
25
|
-
"ext/digest/sha2/sha2init.c", "ext/digest/test.sh", "ext/openssl/deprecation.rb",
|
26
|
-
"lib/digest.rb"
|
27
|
-
]
|
28
|
-
|
29
|
-
spec.required_ruby_version = ">= 2.3.0"
|
30
|
-
|
31
|
-
spec.bindir = "exe"
|
32
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
-
spec.require_paths = ["lib"]
|
34
|
-
spec.extensions = %w[
|
35
|
-
ext/digest/extconf.rb
|
36
|
-
ext/digest/bubblebabble/extconf.rb
|
37
|
-
ext/digest/md5/extconf.rb
|
38
|
-
ext/digest/rmd160/extconf.rb
|
39
|
-
ext/digest/sha1/extconf.rb
|
40
|
-
ext/digest/sha2/extconf.rb
|
41
|
-
]
|
42
|
-
spec.metadata["msys2_mingw_dependencies"] = "openssl"
|
43
|
-
|
44
|
-
spec.add_development_dependency "bundler"
|
45
|
-
spec.add_development_dependency "rake"
|
46
|
-
spec.add_development_dependency "rake-compiler"
|
47
|
-
end
|
data/ext/openssl/deprecation.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
module OpenSSL
|
3
|
-
def self.deprecated_warning_flag
|
4
|
-
unless flag = (@deprecated_warning_flag ||= nil)
|
5
|
-
if try_compile("", flag = "-Werror=deprecated-declarations")
|
6
|
-
$warnflags << " #{flag}"
|
7
|
-
else
|
8
|
-
flag = ""
|
9
|
-
end
|
10
|
-
@deprecated_warning_flag = flag
|
11
|
-
end
|
12
|
-
flag
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.check_func(func, header)
|
16
|
-
have_func(func, header, deprecated_warning_flag)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.check_func_or_macro(func, header)
|
20
|
-
check_func(func, header) or
|
21
|
-
have_macro(func, header) && $defs.push("-DHAVE_#{func.upcase}")
|
22
|
-
end
|
23
|
-
end
|