argon2id 0.4.1-aarch64-linux → 0.5.0-aarch64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a143c7ad5f64a97f92a962d4f91a449f66cdcaf40198f94d1181c97bb8ed335
4
- data.tar.gz: 16b6dec04fed9294444e96c7f78b483da070286028d58cf8f41a01904a428568
3
+ metadata.gz: 4773446c66cd12cdc3860c05d34a27faaa6c8015f3b85ec48a5c4723c2358cfb
4
+ data.tar.gz: 3e31a4204b21bb547d54250d61654929bcd4199b510a261e56cd687eb71d7913
5
5
  SHA512:
6
- metadata.gz: 3d3fe02fd88074c4bfeb371b5f96bf75efae6d02da2a2f9d38b656fb5d9367c18b2e71786cf8294c9373bc8799b85a5a3cad4f7647e9ee71bd3f8f3e2ec79419
7
- data.tar.gz: 7321f8e92b0c7add12b23dcb7fa70abe585ec19160b4fe82eb8fc69dd0ee9eb1335b785e27f5a7c347d9597cc981fe35b0fb969aaed18968ef2f9f68c57f3d6c
6
+ metadata.gz: d1684b89f2ea3dc287fa981736cda8fee635d4a54b4566f07fd302f49ecdee75764341790aee0ed547e89212652c0a50ef4473c76e56b1f79f23fa86d3eaf5aa
7
+ data.tar.gz: 8395d29a5bba114703cf3a552e781367a2afa6df8da7f4f248c9cbfb545f20ae99070d7b077a0f91c2f4d58c271c204febdbaf6ac29987fcdca17876c6b9c3f4
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2024-11-02
9
+
10
+ ### Removed
11
+
12
+ - No longer expose the `type` of an encoded hash as it must always be an
13
+ Argon2id hash
14
+
8
15
  ## [0.4.1] - 2024-11-02
9
16
 
10
17
  ### Changed
@@ -86,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
86
93
  reference C implementation of Argon2, the password-hashing function that won
87
94
  the Password Hashing Competition.
88
95
 
96
+ [0.5.0]: https://github.com/mudge/argon2id/releases/tag/v0.5.0
89
97
  [0.4.1]: https://github.com/mudge/argon2id/releases/tag/v0.4.1
90
98
  [0.4.0]: https://github.com/mudge/argon2id/releases/tag/v0.4.0
91
99
  [0.3.0]: https://github.com/mudge/argon2id/releases/tag/v0.3.0
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby bindings to [Argon2][], the password-hashing function that won the 2015
5
5
 
6
6
  [![Build Status](https://github.com/mudge/argon2id/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mudge/argon2id/actions)
7
7
 
8
- **Current version:** 0.4.1
8
+ **Current version:** 0.5.0
9
9
  **Bundled Argon2 version:** libargon2.1 (20190702)
10
10
 
11
11
  ```ruby
@@ -135,6 +135,10 @@ password == "opensesame" #=> true
135
135
  password == "notopensesame" #=> false
136
136
  ```
137
137
 
138
+ > [!WARNING]
139
+ > `Argon2id::Password.new` does not support hashes generated from other Argon2
140
+ > variants such as Argon2i and Argon2d.
141
+
138
142
  For compatibility with [bcrypt-ruby][], `Argon2id::Password#==` is aliased to `Argon2id::Password.is_password?`:
139
143
 
140
144
  ```ruby
@@ -147,7 +151,6 @@ The various parts of the encoded hash can be retrieved:
147
151
 
148
152
  ```ruby
149
153
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
150
- password.type #=> "argon2id"
151
154
  password.version #=> 19
152
155
  password.m_cost #=> 256
153
156
  password.t_cost #=> 2
@@ -198,11 +201,11 @@ notes](https://github.com/mudge/argon2id/releases) for each version and can be
198
201
  checked with `sha256sum`, e.g.
199
202
 
200
203
  ```console
201
- $ gem fetch argon2id -v 0.4.0
202
- Fetching argon2id-0.4.0-arm64-darwin.gem
203
- Downloaded argon2id-0.4.0-arm64-darwin
204
- $ sha256sum argon2id-0.4.0-arm64-darwin.gem
205
- 2cecd6d5a1ecaf0a025e95714c0dee22dfc3d4585b649c57c06f432031b55a77 argon2id-0.4.0-arm64-darwin.gem
204
+ $ gem fetch argon2id -v 0.4.1
205
+ Fetching argon2id-0.4.1-arm64-darwin.gem
206
+ Downloaded argon2id-0.4.1-arm64-darwin
207
+ $ sha256sum argon2id-0.4.1-arm64-darwin.gem
208
+ c74c06c2c4ce70d6c3822f05d83bab4ea431dd16ec086c9c856da3c6e0d9bbe9 argon2id-0.4.1-arm64-darwin.gem
206
209
  ```
207
210
 
208
211
  [GPG](https://www.gnupg.org/) signatures are attached to each release (the
@@ -212,8 +215,8 @@ from a public keyserver, e.g. `gpg --keyserver keyserver.ubuntu.com --recv-key
212
215
  0x39AC3530070E0F75`):
213
216
 
214
217
  ```console
215
- $ gpg --verify argon2id-0.4.0-arm64-darwin.gem.sig argon2id-0.4.0-arm64-darwin.gem
216
- gpg: Signature made Sat 2 Nov 15:25:15 2024 GMT
218
+ $ gpg --verify argon2id-0.4.1-arm64-darwin.gem.sig argon2id-0.4.1-arm64-darwin.gem
219
+ gpg: Signature made Sat 2 Nov 20:50:54 2024 GMT
217
220
  gpg: using RSA key 702609D9C790F45B577D7BEC39AC3530070E0F75
218
221
  gpg: Good signature from "Paul Mucur <mudge@mudge.name>" [unknown]
219
222
  gpg: aka "Paul Mucur <paul@ghostcassette.com>" [unknown]
@@ -25,7 +25,6 @@ module Argon2id
25
25
  #
26
26
  # You can read various parameters out of a password hash:
27
27
  #
28
- # password.type #=> "argon2id"
29
28
  # password.version #=> 19
30
29
  # password.m_cost #=> 19456
31
30
  # password.t_cost #=> 2
@@ -36,7 +35,7 @@ module Argon2id
36
35
  PATTERN = %r{
37
36
  \A
38
37
  \$
39
- (argon2(?:id|i|d))
38
+ argon2id
40
39
  (?:\$v=(\d+))?
41
40
  \$m=(\d+)
42
41
  ,t=(\d+)
@@ -51,9 +50,6 @@ module Argon2id
51
50
  # The encoded password hash.
52
51
  attr_reader :encoded
53
52
 
54
- # The type of the hashing function.
55
- attr_reader :type
56
-
57
53
  # The version number of the hashing function.
58
54
  attr_reader :version
59
55
 
@@ -113,13 +109,12 @@ module Argon2id
113
109
  raise ArgumentError, "invalid hash" unless PATTERN =~ String(encoded)
114
110
 
115
111
  @encoded = $&
116
- @type = $1
117
- @version = Integer($2 || 0x10)
118
- @m_cost = Integer($3)
119
- @t_cost = Integer($4)
120
- @parallelism = Integer($5)
121
- @salt = $6.unpack1("m")
122
- @output = $7.unpack1("m")
112
+ @version = Integer($1 || 0x10)
113
+ @m_cost = Integer($2)
114
+ @t_cost = Integer($3)
115
+ @parallelism = Integer($4)
116
+ @salt = $5.unpack1("m")
117
+ @output = $6.unpack1("m")
123
118
  end
124
119
 
125
120
  # Return the encoded password hash.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Argon2id
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -98,6 +98,12 @@ class TestPassword < Minitest::Test
98
98
  end
99
99
  end
100
100
 
101
+ def test_raises_for_non_argon2id_hashes
102
+ assert_raises(ArgumentError) do
103
+ Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$iekCn0Y3spW+sCcFanM2xBT63UP2sghkUoHLIUpWRS8")
104
+ end
105
+ end
106
+
101
107
  def test_salt_supports_versionless_hashes
102
108
  password = Argon2id::Password.new("$argon2id$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
103
109
 
@@ -110,18 +116,6 @@ class TestPassword < Minitest::Test
110
116
  assert Argon2id::Password.new(password) == "password"
111
117
  end
112
118
 
113
- def test_extracting_type_from_hash
114
- password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
115
-
116
- assert_equal "argon2id", password.type
117
- end
118
-
119
- def test_extracting_type_from_argoni_hash
120
- password = Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
121
-
122
- assert_equal "argon2i", password.type
123
- end
124
-
125
119
  def test_extracting_version_from_hash
126
120
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
127
121
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argon2id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Paul Mucur