x25519 1.0.5 → 1.0.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 316da0f14382521bac4d5142c22d44d4dbabda25ca5956e8c9d467b8b92661f7
4
- data.tar.gz: 22efb4909f13bcbd27899b26851120a7a3e1d99a0311356191bc78033cd949b9
3
+ metadata.gz: 11ff922b9b148a4f8b37ae6ad4a6e1638930b50b93e5d45a169e0b1399963d22
4
+ data.tar.gz: 2b947a4726bc75e6a492821d25a656cce2852fa9d4b5a72cec491766f0cde724
5
5
  SHA512:
6
- metadata.gz: 719c8a4fb16da08c8a9f8d20d66a78c5a3c003b1eef5e579e1b10062ddf840d14016d85bf292dfd7acd733ef978f7a0c82a0f9c93ed131811dc5e76e7cbdf947
7
- data.tar.gz: bd019615fa2f53475e03b47e6fdd852e4aaffac71a63859b1572f35141998cca75d454e474c57ddd8d3670293e6f492f30f7ec8ecd115ee04354a295b72c0ef3
6
+ metadata.gz: 00caf2f9602bcf4af710eb0eadce522cf0bcf6fa9c00e06c75af67b2c94c24d96d19bd9a0213b6ec30146e13e2d989bc8e145c5690be1773fceb52fa974b914e
7
+ data.tar.gz: dc318a0d65303ffc6ac7e5dd27aefc93bd500e3f56354d13d7264072e331f58aeb36f50cf176cbfcfb1dc082223908544a36b0afd05a8cad68455ca099cda6c5
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ paths-ignore:
6
+ - README.md
7
+ push:
8
+ branches: main
9
+ paths-ignore:
10
+ - README.md
11
+
12
+ env:
13
+ BUNDLE_WITHOUT: "development"
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ ruby:
21
+ - ruby-2.5
22
+ - ruby-2.6
23
+ - ruby-2.7
24
+ - ruby-3.0
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true
31
+ - run: bundle exec rake compile
32
+ - run: bundle exec rake spec
33
+
34
+ rubocop:
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - uses: actions/checkout@v2
38
+ - uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: 2.5
41
+ bundler-cache: true
42
+ - run: bundle exec rubocop --format progress --color
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.2
2
+ TargetRubyVersion: 2.5
3
3
  DisplayCopNames: true
4
4
 
5
5
  #
data/CHANGELOG.md ADDED
@@ -0,0 +1,90 @@
1
+ ## [1.0.9] (2021-08-04)
2
+
3
+ [1.0.9]: https://github.com/RubyCrypto/x25519/compare/v1.0.8...v1.0.9
4
+
5
+ - [#23](https://github.com/RubyCrypto/x25519/pull/23)
6
+ Bump `required_ruby_version` to 2.5
7
+ - [#25](https://github.com/RubyCrypto/x25519/pull/25)
8
+ Fix SIGILL caused by use of `-march=native`
9
+
10
+ ## [1.0.8] (2018-11-08)
11
+
12
+ [1.0.8]: https://github.com/RubyCrypto/x25519/compare/v1.0.7...v1.0.8
13
+
14
+ - [#20](https://github.com/RubyCrypto/x25519/pull/19)
15
+ Change license to BSD-3-clause.
16
+
17
+ ## [1.0.7] (2018-02-26)
18
+
19
+ [1.0.7]: https://github.com/RubyCrypto/x25519/compare/v1.0.6...v1.0.7
20
+
21
+ - [#19](https://github.com/RubyCrypto/x25519/pull/19)
22
+ Incorporate upstream carry propagation bugfix and LICENSE changes.
23
+
24
+ ## [1.0.6] (2018-01-04)
25
+
26
+ [1.0.6]: https://github.com/RubyCrypto/x25519/compare/v1.0.5...v1.0.6
27
+
28
+ - Use correct (LGPLv3) license in gemspec
29
+
30
+ ## [1.0.5] (2017-12-31)
31
+
32
+ [1.0.5]: https://github.com/RubyCrypto/x25519/compare/v1.0.4...v1.0.5
33
+
34
+ - [#15](https://github.com/RubyCrypto/x25519/pull/15)
35
+ RuboCop 0.52.1
36
+
37
+ - [#14](https://github.com/RubyCrypto/x25519/pull/14)
38
+ `ext/x25519_ref10`: Consolidate all field element code into `fe.c`.
39
+
40
+ ## [1.0.4] (2017-12-31)
41
+
42
+ [1.0.4]: https://github.com/RubyCrypto/x25519/compare/v1.0.3...v1.0.4
43
+
44
+ - [#13](https://github.com/RubyCrypto/x25519/pull/13)
45
+ Test against Ruby 2.5.0
46
+
47
+ - [#12](https://github.com/RubyCrypto/x25519/pull/12)
48
+ Move project to the RubyCrypto GitHub organization
49
+
50
+ ## [1.0.3] (2017-12-13)
51
+
52
+ [1.0.3]: https://github.com/RubyCrypto/x25519/compare/v1.0.2...v1.0.3
53
+
54
+ - [#10](https://github.com/RubyCrypto/x25519/pull/10)
55
+ Detect degenerate (i.e. all-zero) public keys (fixes #6)
56
+
57
+ ## [1.0.2] (2017-12-13)
58
+
59
+ [1.0.2]: https://github.com/RubyCrypto/x25519/compare/v1.0.1...v1.0.2
60
+
61
+ - [#9](https://github.com/RubyCrypto/x25519/pull/9)
62
+ Make `X25519.provider` an `attr_accessor`
63
+ - Raise `X25519::SelfTestFailure` when self-test fails
64
+
65
+ ## [1.0.1] (2017-12-12)
66
+
67
+ [1.0.1]: https://github.com/RubyCrypto/x25519/compare/v1.0.0...v1.0.1
68
+
69
+ - Have `X25519.self_test` return true on success
70
+
71
+ ## [1.0.0] (2017-12-12)
72
+
73
+ [1.0.0]: https://github.com/RubyCrypto/x25519/compare/v0.2.0...v1.0.0
74
+
75
+ - [#8](https://github.com/RubyCrypto/x25519/pull/8)
76
+ Add self-test
77
+
78
+ - [#7](https://github.com/RubyCrypto/x25519/pull/7)
79
+ Factor providers into the `X25519::Provider` namespace
80
+
81
+ ## [0.2.0] (2017-12-12)
82
+
83
+ [0.2.0]: https://github.com/RubyCrypto/x25519/compare/v0.1.0...v0.2.0
84
+
85
+ - [#5](https://github.com/RubyCrypto/x25519/pull/5)
86
+ Rewrite gem in Ruby with minimal native extensions
87
+
88
+ ## 0.1.0 (2017-12-11)
89
+
90
+ - Initial release
data/Gemfile CHANGED
@@ -7,6 +7,6 @@ gemspec
7
7
  group :development, :test do
8
8
  gem "rake", require: false
9
9
  gem "rake-compiler", "~> 1.0", require: false
10
- gem "rspec", "~> 3.7", require: false
11
- gem "rubocop", "0.52.1", require: false
10
+ gem "rspec", "~> 3.10", require: false
11
+ gem "rubocop", "1.18", require: false
12
12
  end
data/LICENSE CHANGED
@@ -1,165 +1,32 @@
1
- GNU LESSER GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
-
9
- This version of the GNU Lesser General Public License incorporates
10
- the terms and conditions of version 3 of the GNU General Public
11
- License, supplemented by the additional permissions listed below.
12
-
13
- 0. Additional Definitions.
14
-
15
- As used herein, "this License" refers to version 3 of the GNU Lesser
16
- General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
- General Public License.
18
-
19
- "The Library" refers to a covered work governed by this License,
20
- other than an Application or a Combined Work as defined below.
21
-
22
- An "Application" is any work that makes use of an interface provided
23
- by the Library, but which is not otherwise based on the Library.
24
- Defining a subclass of a class defined by the Library is deemed a mode
25
- of using an interface provided by the Library.
26
-
27
- A "Combined Work" is a work produced by combining or linking an
28
- Application with the Library. The particular version of the Library
29
- with which the Combined Work was made is also called the "Linked
30
- Version".
31
-
32
- The "Minimal Corresponding Source" for a Combined Work means the
33
- Corresponding Source for the Combined Work, excluding any source code
34
- for portions of the Combined Work that, considered in isolation, are
35
- based on the Application, and not on the Linked Version.
36
-
37
- The "Corresponding Application Code" for a Combined Work means the
38
- object code and/or source code for the Application, including any data
39
- and utility programs needed for reproducing the Combined Work from the
40
- Application, but excluding the System Libraries of the Combined Work.
41
-
42
- 1. Exception to Section 3 of the GNU GPL.
43
-
44
- You may convey a covered work under sections 3 and 4 of this License
45
- without being bound by section 3 of the GNU GPL.
46
-
47
- 2. Conveying Modified Versions.
48
-
49
- If you modify a copy of the Library, and, in your modifications, a
50
- facility refers to a function or data to be supplied by an Application
51
- that uses the facility (other than as an argument passed when the
52
- facility is invoked), then you may convey a copy of the modified
53
- version:
54
-
55
- a) under this License, provided that you make a good faith effort to
56
- ensure that, in the event an Application does not supply the
57
- function or data, the facility still operates, and performs
58
- whatever part of its purpose remains meaningful, or
59
-
60
- b) under the GNU GPL, with none of the additional permissions of
61
- this License applicable to that copy.
62
-
63
- 3. Object Code Incorporating Material from Library Header Files.
64
-
65
- The object code form of an Application may incorporate material from
66
- a header file that is part of the Library. You may convey such object
67
- code under terms of your choice, provided that, if the incorporated
68
- material is not limited to numerical parameters, data structure
69
- layouts and accessors, or small macros, inline functions and templates
70
- (ten or fewer lines in length), you do both of the following:
71
-
72
- a) Give prominent notice with each copy of the object code that the
73
- Library is used in it and that the Library and its use are
74
- covered by this License.
75
-
76
- b) Accompany the object code with a copy of the GNU GPL and this license
77
- document.
78
-
79
- 4. Combined Works.
80
-
81
- You may convey a Combined Work under terms of your choice that,
82
- taken together, effectively do not restrict modification of the
83
- portions of the Library contained in the Combined Work and reverse
84
- engineering for debugging such modifications, if you also do each of
85
- the following:
86
-
87
- a) Give prominent notice with each copy of the Combined Work that
88
- the Library is used in it and that the Library and its use are
89
- covered by this License.
90
-
91
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
- document.
93
-
94
- c) For a Combined Work that displays copyright notices during
95
- execution, include the copyright notice for the Library among
96
- these notices, as well as a reference directing the user to the
97
- copies of the GNU GPL and this license document.
98
-
99
- d) Do one of the following:
100
-
101
- 0) Convey the Minimal Corresponding Source under the terms of this
102
- License, and the Corresponding Application Code in a form
103
- suitable for, and under terms that permit, the user to
104
- recombine or relink the Application with a modified version of
105
- the Linked Version to produce a modified Combined Work, in the
106
- manner specified by section 6 of the GNU GPL for conveying
107
- Corresponding Source.
108
-
109
- 1) Use a suitable shared library mechanism for linking with the
110
- Library. A suitable mechanism is one that (a) uses at run time
111
- a copy of the Library already present on the user's computer
112
- system, and (b) will operate properly with a modified version
113
- of the Library that is interface-compatible with the Linked
114
- Version.
115
-
116
- e) Provide Installation Information, but only if you would otherwise
117
- be required to provide such information under section 6 of the
118
- GNU GPL, and only to the extent that such information is
119
- necessary to install and execute a modified version of the
120
- Combined Work produced by recombining or relinking the
121
- Application with a modified version of the Linked Version. (If
122
- you use option 4d0, the Installation Information must accompany
123
- the Minimal Corresponding Source and Corresponding Application
124
- Code. If you use option 4d1, you must provide the Installation
125
- Information in the manner specified by section 6 of the GNU GPL
126
- for conveying Corresponding Source.)
127
-
128
- 5. Combined Libraries.
129
-
130
- You may place library facilities that are a work based on the
131
- Library side by side in a single library together with other library
132
- facilities that are not Applications and are not covered by this
133
- License, and convey such a combined library under terms of your
134
- choice, if you do both of the following:
135
-
136
- a) Accompany the combined library with a copy of the same work based
137
- on the Library, uncombined with any other library facilities,
138
- conveyed under the terms of this License.
139
-
140
- b) Give prominent notice with the combined library that part of it
141
- is a work based on the Library, and explaining where to find the
142
- accompanying uncombined form of the same work.
143
-
144
- 6. Revised Versions of the GNU Lesser General Public License.
145
-
146
- The Free Software Foundation may publish revised and/or new versions
147
- of the GNU Lesser General Public License from time to time. Such new
148
- versions will be similar in spirit to the present version, but may
149
- differ in detail to address new problems or concerns.
150
-
151
- Each version is given a distinguishing version number. If the
152
- Library as you received it specifies that a certain numbered version
153
- of the GNU Lesser General Public License "or any later version"
154
- applies to it, you have the option of following the terms and
155
- conditions either of that published version or of any later version
156
- published by the Free Software Foundation. If the Library as you
157
- received it does not specify a version number of the GNU Lesser
158
- General Public License, you may choose any version of the GNU Lesser
159
- General Public License ever published by the Free Software Foundation.
160
-
161
- If the Library as you received it specifies that a proxy can decide
162
- whether future versions of the GNU Lesser General Public License shall
163
- apply, that proxy's public statement of acceptance of any version is
164
- permanent authorization for you to choose that version for the
165
- Library.
1
+ BSD-3 License.
2
+
3
+ Copyright (c) 2017, Armando Faz <armfazh@ic.unicamp.br>. All rights reserved.
4
+ Institute of Computing.
5
+ University of Campinas, Brazil.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions
9
+ are met:
10
+
11
+ * Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+ * Redistributions in binary form must reproduce the above
14
+ copyright notice, this list of conditions and the following
15
+ disclaimer in the documentation and/or other materials provided
16
+ with the distribution.
17
+ * Neither the name of University of Campinas nor the names of its
18
+ contributors may be used to endorse or promote products derived
19
+ from this software without specific prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
32
+ OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
- # x25519.rb [![Latest Version][gem-shield]][gem-link] [![Build Status][build-image]][build-link] [![Appveyor CI Status][appveyor-image]][appveyor-link] [![Yard Docs][docs-image]][docs-link] [![License: LGPL v3][license-image]][license-link]
1
+ # x25519.rb [![Latest Version][gem-shield]][gem-link] [![Yard Docs][docs-image]][docs-link] [![License: BSD 3-Clause][license-image]][license-link] [![Build Status][build-image]][build-link]
2
2
 
3
- [gem-shield]: https://badge.fury.io/rb/x25519.svg
3
+ [gem-shield]: https://img.shields.io/gem/v/x25519?logo=ruby
4
4
  [gem-link]: https://rubygems.org/gems/x25519
5
- [build-image]: https://travis-ci.org/crypto-rb/x25519.svg?branch=master
6
- [build-link]: https://travis-ci.org/crypto-rb/x25519
7
- [appveyor-image]: https://ci.appveyor.com/api/projects/status/a245an53hsk05sn2?svg=true
8
- [appveyor-link]: https://ci.appveyor.com/project/tarcieri/x25519
9
5
  [docs-image]: https://img.shields.io/badge/yard-docs-blue.svg
10
- [docs-link]: http://www.rubydoc.info/gems/x25519/1.0.5
11
- [license-image]: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
12
- [license-link]: https://www.gnu.org/licenses/lgpl-3.0
6
+ [docs-link]: http://www.rubydoc.info/gems/x25519/1.0.6
7
+ [license-image]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
8
+ [license-link]: https://spdx.org/licenses/BSD-3-Clause.html
9
+ [build-image]: https://github.com/RubyCrypto/x25519/actions/workflows/ci.yml/badge.svg
10
+ [build-link]: https://github.com/RubyCrypto/x25519/actions/workflows/ci.yml
13
11
 
14
12
  An efficient public key cryptography library for Ruby providing key
15
13
  exchange/agreement.
@@ -28,13 +26,30 @@ Curve25519.
28
26
  [RFC7748]: https://tools.ietf.org/html/rfc7748
29
27
  [How to (pre-)compute a ladder]: https://eprint.iacr.org/2017/264
30
28
  [rfc7748_precomputed]: https://github.com/armfazh/rfc7748_precomputed
31
- [ed25519 gem]: https://github.com/crypto-rb/ed25519
29
+ [ed25519 gem]: https://github.com/RubyCrypto/ed25519
30
+
31
+ ### Is it any good?
32
+
33
+ [Yes.](http://news.ycombinator.com/item?id=3067434)
34
+
35
+ ### What is it useful for?
36
+
37
+ X25519 is a key exchange/agreement algorithm generally used as a low-level
38
+ building block in cryptographic protocols.
39
+
40
+ ### Can I use X25519 to encrypt things?
41
+
42
+ Please use [RbNaCl::Box] if you would like a high-level construction which uses
43
+ X25519 for public-key encryption. Otherwise, the X25519 algorithm is not directly
44
+ useful for encryption without a higher-level encryption protocol built on top of it.
45
+
46
+ [RbNaCl::Box]: https://github.com/RubyCrypto/rbnacl/wiki/Public-Key-Encryption
32
47
 
33
48
  ## Requirements
34
49
 
35
50
  **x25519.rb** is supported on and tested against the following platforms:
36
51
 
37
- * MRI 2.2, 2.3, 2.4, 2.5
52
+ - MRI 2.5, 2.6, 2.7, 3.0
38
53
 
39
54
  ## Installation
40
55
 
@@ -214,9 +229,9 @@ Returns a `String` containing a 32-byte compressed Montgomery-u coordinate
214
229
 
215
230
  ## Contributing
216
231
 
217
- Bug reports and pull requests are welcome on GitHub at https://github.com/crypto-rb/x25519.
232
+ Bug reports and pull requests are welcome on GitHub at https://github.com/RubyCrypto/x25519.
218
233
  This project is intended to be a safe, welcoming space for collaboration,
219
- and contributors areexpected to adhere to the [Contributor Covenant](http://contributor-covenant.org)
234
+ and contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org)
220
235
  code of conduct.
221
236
 
222
237
  ## Implementation Details
@@ -227,7 +242,8 @@ based on available CPU features.
227
242
 
228
243
  ### [rfc7748_precomputed]: optimized assembly implementation
229
244
 
230
- * Prime field arithmetic is optimized for the 4th and 6th generation of Intel Core processors (Haswell and Skylake micro-architectures).
245
+ * Prime field arithmetic is optimized for the 4th and 6th generation of Intel Core processors
246
+ (Haswell and Skylake micro-architectures).
231
247
  * Efficient integer multiplication using MULX instruction.
232
248
  * Integer additions accelerated with ADCX/ADOX instructions.
233
249
  * Key generation uses a read-only table of 8 KB for X25519.
@@ -253,16 +269,17 @@ The optimized [rfc7748_precomputed] implementation was designed by:
253
269
  * Armando Faz-Hernández, University of Campinas, Brazil.
254
270
  * Francisco Rodríguez-Henríquez, Computer Science Department, Cinvestav-IPN, Mexico.
255
271
 
256
- ## Copyright and License
272
+ ## License
257
273
 
258
- Copyright (c) 2017 Armando Faz, Tony Arcieri
274
+ Copyright (c) 2017-2018 Armando Faz
275
+ Copyright (c) 2017-2021 Tony Arcieri
259
276
 
260
277
  This gem is available as open source under the terms of the
261
- GNU Lesser General Public License v3.0 ([LICENSE](https://www.gnu.org/licenses/lgpl-3.0.txt))
278
+ BSD-3 Clause License ([LICENSE](./LICENSE))
262
279
 
263
280
  ## Code of Conduct
264
281
 
265
282
  Everyone interacting in the x25519.rb project’s codebases, issue trackers, chat
266
283
  rooms and mailing lists is expected to follow the [code of conduct].
267
284
 
268
- [code of conduct]: https://github.com/crypto-rb/x25519/blob/master/CODE_OF_CONDUCT.md
285
+ [code of conduct]: https://github.com/RubyCrypto/x25519/blob/main/CODE_OF_CONDUCT.md