argon2 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -2
- data/.rubocop.yml +80 -2
- data/argon2.gemspec +5 -2
- data/ext/argon2_wrap/libargon2_wrap.so +0 -0
- data/ext/phc-winner-argon2/Makefile +1 -1
- data/ext/phc-winner-argon2/Package.swift +46 -0
- data/ext/phc-winner-argon2/README.md +8 -4
- data/lib/argon2/version.rb +1 -1
- data/sig/argon2.rbs +6 -1
- data/sig/ffi.rbs +18 -0
- metadata +12 -10
- data/ext/phc-winner-argon2/opt.o +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bff7ddef087d3f6715d16badbd5e9c5751445fb1016e5e1b7c28a3e1be7969fa
|
4
|
+
data.tar.gz: bc1bd994565169c1d2b30cdb29ad47fc9ad6b2fcd7667ec567357e4beae644fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db612e16de69bd3a6e680a163d3af9bbc59834dff17546dc603d0f6adfd0035f0b15a5e6f4779a8c7e578ac03217dca93d4771efea8af675aeaaf691c911685d
|
7
|
+
data.tar.gz: 711745dd87ae4add9e23154ff3efd1b8674a73b3f2e5b0693c10a968f8f4060b51379f5c11d56678996fdd79f1ba8b69f368f5810e4c9c4c6a04e5a01cf0956e
|
data/.github/workflows/ruby.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -210,8 +210,6 @@ Style/RedundantArgument: # (new in 1.4)
|
|
210
210
|
Enabled: true
|
211
211
|
Style/SwapValues: # (new in 1.1)
|
212
212
|
Enabled: true
|
213
|
-
Gemspec/DateAssignment: # (new in 1.10)
|
214
|
-
Enabled: true
|
215
213
|
Lint/DeprecatedConstants: # (new in 1.8)
|
216
214
|
Enabled: true
|
217
215
|
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
|
@@ -234,3 +232,83 @@ Style/IfWithBooleanLiteralBranches: # (new in 1.9)
|
|
234
232
|
Enabled: true
|
235
233
|
Style/StringChars: # (new in 1.12)
|
236
234
|
Enabled: true
|
235
|
+
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
236
|
+
Enabled: true
|
237
|
+
Gemspec/RequireMFA: # new in 1.23
|
238
|
+
Enabled: true
|
239
|
+
Layout/LineContinuationLeadingSpace: # new in 1.31
|
240
|
+
Enabled: true
|
241
|
+
Layout/LineContinuationSpacing: # new in 1.31
|
242
|
+
Enabled: true
|
243
|
+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
|
244
|
+
Enabled: true
|
245
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
246
|
+
Enabled: true
|
247
|
+
Lint/AmbiguousRange: # new in 1.19
|
248
|
+
Enabled: true
|
249
|
+
Lint/ConstantOverwrittenInRescue: # new in 1.31
|
250
|
+
Enabled: true
|
251
|
+
Lint/DuplicateMagicComment: # new in 1.37
|
252
|
+
Enabled: true
|
253
|
+
Lint/EmptyInPattern: # new in 1.16
|
254
|
+
Enabled: true
|
255
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
256
|
+
Enabled: true
|
257
|
+
Lint/NonAtomicFileOperation: # new in 1.31
|
258
|
+
Enabled: true
|
259
|
+
Lint/RefinementImportMethods: # new in 1.27
|
260
|
+
Enabled: true
|
261
|
+
Lint/RequireRangeParentheses: # new in 1.32
|
262
|
+
Enabled: true
|
263
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
264
|
+
Enabled: true
|
265
|
+
Lint/UselessRuby2Keywords: # new in 1.23
|
266
|
+
Enabled: true
|
267
|
+
Naming/BlockForwarding: # new in 1.24
|
268
|
+
Enabled: true
|
269
|
+
Security/CompoundHash: # new in 1.28
|
270
|
+
Enabled: true
|
271
|
+
Security/IoMethods: # new in 1.22
|
272
|
+
Enabled: true
|
273
|
+
Style/EmptyHeredoc: # new in 1.32
|
274
|
+
Enabled: true
|
275
|
+
Style/EnvHome: # new in 1.29
|
276
|
+
Enabled: true
|
277
|
+
Style/FetchEnvVar: # new in 1.28
|
278
|
+
Enabled: true
|
279
|
+
Style/FileRead: # new in 1.24
|
280
|
+
Enabled: true
|
281
|
+
Style/FileWrite: # new in 1.24
|
282
|
+
Enabled: true
|
283
|
+
Style/InPatternThen: # new in 1.16
|
284
|
+
Enabled: true
|
285
|
+
Style/MagicCommentFormat: # new in 1.35
|
286
|
+
Enabled: true
|
287
|
+
Style/MapCompactWithConditionalBlock: # new in 1.30
|
288
|
+
Enabled: true
|
289
|
+
Style/MapToHash: # new in 1.24
|
290
|
+
Enabled: true
|
291
|
+
Style/MultilineInPatternThen: # new in 1.16
|
292
|
+
Enabled: true
|
293
|
+
Style/NestedFileDirname: # new in 1.26
|
294
|
+
Enabled: true
|
295
|
+
Style/NumberedParameters: # new in 1.22
|
296
|
+
Enabled: true
|
297
|
+
Style/NumberedParametersLimit: # new in 1.22
|
298
|
+
Enabled: true
|
299
|
+
Style/ObjectThen: # new in 1.28
|
300
|
+
Enabled: true
|
301
|
+
Style/OpenStructUse: # new in 1.23
|
302
|
+
Enabled: true
|
303
|
+
Style/OperatorMethodCall: # new in 1.37
|
304
|
+
Enabled: true
|
305
|
+
Style/QuotedSymbols: # new in 1.16
|
306
|
+
Enabled: true
|
307
|
+
Style/RedundantInitialize: # new in 1.27
|
308
|
+
Enabled: true
|
309
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
310
|
+
Enabled: true
|
311
|
+
Style/RedundantStringEscape: # new in 1.37
|
312
|
+
Enabled: true
|
313
|
+
Style/SelectByRegexp: # new in 1.22
|
314
|
+
Enabled: true
|
data/argon2.gemspec
CHANGED
@@ -17,8 +17,11 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.description = 'Argon2 FFI binding'
|
18
18
|
spec.homepage = 'https://github.com/technion/ruby-argon2'
|
19
19
|
spec.license = 'MIT'
|
20
|
+
spec.metadata = {
|
21
|
+
'rubygems_mfa_required' => 'true'
|
22
|
+
}
|
20
23
|
|
21
|
-
spec.files
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
25
|
spec.files << `find ext`.split
|
23
26
|
|
24
27
|
spec.bindir = "exe"
|
@@ -33,6 +36,6 @@ Gem::Specification.new do |spec|
|
|
33
36
|
spec.add_development_dependency "rubocop", '~> 1.7'
|
34
37
|
spec.add_development_dependency "simplecov", '~> 0.20'
|
35
38
|
spec.add_development_dependency "simplecov-lcov", '~> 0.8'
|
36
|
-
spec.add_development_dependency "steep", "~>
|
39
|
+
spec.add_development_dependency "steep", "~> 1.2.1"
|
37
40
|
spec.extensions << 'ext/argon2_wrap/extconf.rb'
|
38
41
|
end
|
Binary file
|
@@ -83,7 +83,7 @@ ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),DragonFly FreeBSD NetBSD OpenBSD))
|
|
83
83
|
endif
|
84
84
|
ifeq ($(KERNEL_NAME), Darwin)
|
85
85
|
LIB_EXT := $(ABI_VERSION).dylib
|
86
|
-
LIB_CFLAGS
|
86
|
+
LIB_CFLAGS = -dynamiclib -install_name $(PREFIX)/$(LIBRARY_REL)/lib$(LIB_NAME).$(LIB_EXT)
|
87
87
|
LINKED_LIB_EXT := dylib
|
88
88
|
PC_EXTRA_LIBS ?=
|
89
89
|
endif
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// swift-tools-version:5.3
|
2
|
+
|
3
|
+
import PackageDescription
|
4
|
+
|
5
|
+
let package = Package(
|
6
|
+
name: "argon2",
|
7
|
+
products: [
|
8
|
+
.library(
|
9
|
+
name: "argon2",
|
10
|
+
targets: ["argon2"]),
|
11
|
+
],
|
12
|
+
targets: [
|
13
|
+
.target(
|
14
|
+
name: "argon2",
|
15
|
+
path: ".",
|
16
|
+
exclude: [
|
17
|
+
"kats",
|
18
|
+
"vs2015",
|
19
|
+
"latex",
|
20
|
+
"libargon2.pc.in",
|
21
|
+
"export.sh",
|
22
|
+
"appveyor.yml",
|
23
|
+
"Argon2.sln",
|
24
|
+
"argon2-specs.pdf",
|
25
|
+
"CHANGELOG.md",
|
26
|
+
"LICENSE",
|
27
|
+
"Makefile",
|
28
|
+
"man",
|
29
|
+
"README.md",
|
30
|
+
"src/bench.c",
|
31
|
+
"src/genkat.c",
|
32
|
+
"src/opt.c",
|
33
|
+
"src/run.c",
|
34
|
+
"src/test.c",
|
35
|
+
],
|
36
|
+
sources: [
|
37
|
+
"src/blake2/blake2b.c",
|
38
|
+
"src/argon2.c",
|
39
|
+
"src/core.c",
|
40
|
+
"src/encoding.c",
|
41
|
+
"src/ref.c",
|
42
|
+
"src/thread.c"
|
43
|
+
]
|
44
|
+
)
|
45
|
+
]
|
46
|
+
)
|
@@ -44,9 +44,11 @@ Please report bugs as issues on this repository.
|
|
44
44
|
## Usage
|
45
45
|
|
46
46
|
`make` builds the executable `argon2`, the static library `libargon2.a`,
|
47
|
-
and the shared library `libargon2.so` (or
|
48
|
-
|
49
|
-
|
47
|
+
and the shared library `libargon2.so` (or on macOS, the dynamic library
|
48
|
+
`libargon2.dylib` -- make sure to specify the installation prefix when
|
49
|
+
you compile: `make PREFIX=/usr`). Make sure to run `make test` to verify
|
50
|
+
that your build produces valid results. `sudo make install PREFIX=/usr`
|
51
|
+
installs it to your system.
|
50
52
|
|
51
53
|
### Command-line utility
|
52
54
|
|
@@ -148,7 +150,7 @@ int main(void)
|
|
148
150
|
uint8_t *pwd = (uint8_t *)strdup(PWD);
|
149
151
|
uint32_t pwdlen = strlen((char *)pwd);
|
150
152
|
|
151
|
-
uint32_t t_cost = 2; //
|
153
|
+
uint32_t t_cost = 2; // 2-pass computation
|
152
154
|
uint32_t m_cost = (1<<16); // 64 mebibytes memory usage
|
153
155
|
uint32_t parallelism = 1; // number of threads and lanes
|
154
156
|
|
@@ -244,6 +246,7 @@ Bindings are available for the following languages (make sure to read
|
|
244
246
|
their documentation):
|
245
247
|
|
246
248
|
* [Android (Java/Kotlin)](https://github.com/lambdapioneer/argon2kt) by [@lambdapioneer](https://github.com/lambdapioneer)
|
249
|
+
* [Dart](https://github.com/tmthecoder/dargon2) by [@tmthecoder](https://github.com/tmthecoder)
|
247
250
|
* [Elixir](https://github.com/riverrun/argon2_elixir) by [@riverrun](https://github.com/riverrun)
|
248
251
|
* [Erlang](https://github.com/ergenius/eargon2) by [@ergenius](https://github.com/ergenius)
|
249
252
|
* [Go](https://github.com/tvdburgt/go-argon2) by [@tvdburgt](https://github.com/tvdburgt)
|
@@ -269,6 +272,7 @@ their documentation):
|
|
269
272
|
* [Perl](https://github.com/Leont/crypt-argon2) by [@leont](https://github.com/Leont)
|
270
273
|
* [mruby](https://github.com/Asmod4n/mruby-argon2) by [@Asmod4n](https://github.com/Asmod4n)
|
271
274
|
* [Swift](https://github.com/ImKcat/CatCrypto) by [@ImKcat](https://github.com/ImKcat)
|
275
|
+
* [Swift](https://github.com/tmthecoder/Argon2Swift) by [@tmthecoder](https://github.com/tmthecoder)
|
272
276
|
|
273
277
|
|
274
278
|
## Test suite
|
data/lib/argon2/version.rb
CHANGED
data/sig/argon2.rbs
CHANGED
@@ -7,10 +7,15 @@ module Argon2
|
|
7
7
|
@salt: nil | String
|
8
8
|
@secret: nil | String
|
9
9
|
|
10
|
-
def initialize: (
|
10
|
+
def initialize: (?::Hash[untyped, untyped] options) -> void
|
11
11
|
def create: (String pass) -> untyped
|
12
12
|
def self.create: (String pass) -> untyped
|
13
13
|
def self.valid_hash?: (string hash) -> Integer?
|
14
14
|
def self.verify_password: (untyped pass, untyped hash, ?nil secret) -> untyped
|
15
15
|
end
|
16
|
+
class Engine
|
17
|
+
def self.saltgen: () -> String
|
18
|
+
end
|
19
|
+
class ArgonHashFail < StandardError
|
20
|
+
end
|
16
21
|
end
|
data/sig/ffi.rbs
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Argon2
|
2
|
+
# Direct external bindings. Call these methods via the Engine class to ensure points are dealt with
|
3
|
+
module Ext
|
4
|
+
extend FFI::Library
|
5
|
+
end
|
6
|
+
|
7
|
+
# The engine class shields users from the FFI interface.
|
8
|
+
# It is generally not advised to directly use this class.
|
9
|
+
class Engine
|
10
|
+
def self.hash_argon2i: (untyped password, untyped salt, untyped t_cost, untyped m_cost, ?untyped? out_len) -> untyped
|
11
|
+
|
12
|
+
def self.hash_argon2id: (untyped password, untyped salt, untyped t_cost, untyped m_cost, untyped p_cost, ?untyped? out_len) -> untyped
|
13
|
+
|
14
|
+
def self.hash_argon2id_encode: (untyped password, untyped salt, untyped t_cost, untyped m_cost, untyped p_cost, untyped secret) -> untyped
|
15
|
+
|
16
|
+
def self.argon2_verify: (untyped pwd, untyped hash, untyped secret) -> (false | true)
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: argon2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Technion
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 1.2.1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 1.2.1
|
139
139
|
description: Argon2 FFI binding
|
140
140
|
email:
|
141
141
|
- technion@lolware.net
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- ext/phc-winner-argon2/CHANGELOG.md
|
173
173
|
- ext/phc-winner-argon2/LICENSE
|
174
174
|
- ext/phc-winner-argon2/Makefile
|
175
|
+
- ext/phc-winner-argon2/Package.swift
|
175
176
|
- ext/phc-winner-argon2/README.md
|
176
177
|
- ext/phc-winner-argon2/appveyor.yml
|
177
178
|
- ext/phc-winner-argon2/argon2-specs.pdf
|
@@ -203,7 +204,6 @@ files:
|
|
203
204
|
- ext/phc-winner-argon2/latex/tradeoff.bib
|
204
205
|
- ext/phc-winner-argon2/libargon2.pc.in
|
205
206
|
- ext/phc-winner-argon2/man/argon2.1
|
206
|
-
- ext/phc-winner-argon2/opt.o
|
207
207
|
- ext/phc-winner-argon2/src/argon2.c
|
208
208
|
- ext/phc-winner-argon2/src/bench.c
|
209
209
|
- ext/phc-winner-argon2/src/blake2/blake2-impl.h
|
@@ -252,12 +252,14 @@ files:
|
|
252
252
|
- lib/argon2/version.rb
|
253
253
|
- sig/argon2.rbs
|
254
254
|
- sig/constants.rbs
|
255
|
+
- sig/ffi.rbs
|
255
256
|
- sig/version.rbs
|
256
257
|
homepage: https://github.com/technion/ruby-argon2
|
257
258
|
licenses:
|
258
259
|
- MIT
|
259
|
-
metadata:
|
260
|
-
|
260
|
+
metadata:
|
261
|
+
rubygems_mfa_required: 'true'
|
262
|
+
post_install_message:
|
261
263
|
rdoc_options: []
|
262
264
|
require_paths:
|
263
265
|
- lib
|
@@ -272,8 +274,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
274
|
- !ruby/object:Gem::Version
|
273
275
|
version: '0'
|
274
276
|
requirements: []
|
275
|
-
rubygems_version: 3.
|
276
|
-
signing_key:
|
277
|
+
rubygems_version: 3.3.5
|
278
|
+
signing_key:
|
277
279
|
specification_version: 4
|
278
280
|
summary: Argon2 Password hashing binding
|
279
281
|
test_files: []
|
data/ext/phc-winner-argon2/opt.o
DELETED
Binary file
|