ed-precompiled_ed25519 1.4.0-arm64-darwin

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.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES.md +88 -0
  3. data/LICENSE +22 -0
  4. data/README.md +181 -0
  5. data/ed25519.png +0 -0
  6. data/ext/ed25519_jruby/LICENSE.txt +123 -0
  7. data/ext/ed25519_jruby/README.md +77 -0
  8. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/EdDSAEngine.java +491 -0
  9. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/EdDSAKey.java +31 -0
  10. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/EdDSAPrivateKey.java +338 -0
  11. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/EdDSAPublicKey.java +275 -0
  12. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/EdDSASecurityProvider.java +59 -0
  13. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/KeyFactory.java +75 -0
  14. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/KeyPairGenerator.java +97 -0
  15. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/Utils.java +103 -0
  16. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/Constants.java +23 -0
  17. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/Curve.java +100 -0
  18. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/Encoding.java +54 -0
  19. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/Field.java +99 -0
  20. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/FieldElement.java +76 -0
  21. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/GroupElement.java +1034 -0
  22. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/ScalarOps.java +34 -0
  23. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/bigint/BigIntegerFieldElement.java +131 -0
  24. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/bigint/BigIntegerLittleEndianEncoding.java +102 -0
  25. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/bigint/BigIntegerScalarOps.java +37 -0
  26. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/bigint/package.html +6 -0
  27. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/ed25519/Ed25519FieldElement.java +988 -0
  28. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java +256 -0
  29. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/math/ed25519/Ed25519ScalarOps.java +693 -0
  30. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSAGenParameterSpec.java +32 -0
  31. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSANamedCurveSpec.java +35 -0
  32. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSANamedCurveTable.java +71 -0
  33. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSAParameterSpec.java +97 -0
  34. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSAPrivateKeySpec.java +133 -0
  35. data/ext/ed25519_jruby/net/i2p/crypto/eddsa/spec/EdDSAPublicKeySpec.java +61 -0
  36. data/ext/ed25519_jruby/org/cryptorb/Ed25519Provider.java +95 -0
  37. data/ext/ed25519_ref10/api.h +4 -0
  38. data/ext/ed25519_ref10/base.h +1344 -0
  39. data/ext/ed25519_ref10/base2.h +40 -0
  40. data/ext/ed25519_ref10/d.h +1 -0
  41. data/ext/ed25519_ref10/d2.h +1 -0
  42. data/ext/ed25519_ref10/ed25519_ref10.c +99 -0
  43. data/ext/ed25519_ref10/ed25519_ref10.h +33 -0
  44. data/ext/ed25519_ref10/extconf.rb +7 -0
  45. data/ext/ed25519_ref10/fe.c +1085 -0
  46. data/ext/ed25519_ref10/fe.h +56 -0
  47. data/ext/ed25519_ref10/ge.c +407 -0
  48. data/ext/ed25519_ref10/ge.h +95 -0
  49. data/ext/ed25519_ref10/ge_add.h +97 -0
  50. data/ext/ed25519_ref10/ge_madd.h +88 -0
  51. data/ext/ed25519_ref10/ge_msub.h +88 -0
  52. data/ext/ed25519_ref10/ge_p2_dbl.h +73 -0
  53. data/ext/ed25519_ref10/ge_sub.h +97 -0
  54. data/ext/ed25519_ref10/keypair.c +22 -0
  55. data/ext/ed25519_ref10/open.c +47 -0
  56. data/ext/ed25519_ref10/pow22523.h +160 -0
  57. data/ext/ed25519_ref10/pow225521.h +160 -0
  58. data/ext/ed25519_ref10/sc.h +17 -0
  59. data/ext/ed25519_ref10/sc_muladd.c +366 -0
  60. data/ext/ed25519_ref10/sc_reduce.c +272 -0
  61. data/ext/ed25519_ref10/sha512.c +304 -0
  62. data/ext/ed25519_ref10/sha512.h +8 -0
  63. data/ext/ed25519_ref10/sign.c +41 -0
  64. data/ext/ed25519_ref10/sqrtm1.h +1 -0
  65. data/ext/ed25519_ref10/verify.c +40 -0
  66. data/lib/3.0/ed25519_ref10.bundle +0 -0
  67. data/lib/3.1/ed25519_ref10.bundle +0 -0
  68. data/lib/3.2/ed25519_ref10.bundle +0 -0
  69. data/lib/3.3/ed25519_ref10.bundle +0 -0
  70. data/lib/3.4/ed25519_ref10.bundle +0 -0
  71. data/lib/ed25519/signing_key.rb +60 -0
  72. data/lib/ed25519/verify_key.rb +45 -0
  73. data/lib/ed25519/version.rb +5 -0
  74. data/lib/ed25519.rb +77 -0
  75. metadata +133 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ef32f067c73c324ee07495b6fd6671daf2d194caba29197ff7325741970617d5
4
+ data.tar.gz: a8808487f6f72b2375ad45e08c08f1aa3610fd9fb9708efc69f0bd83eedc43e4
5
+ SHA512:
6
+ metadata.gz: 67d72091baa7de5cd1dc08ff1cd51a55a38d957fa467eb45f5affbf3f4b1572eb6e4c0206ee57a5b25cc456e8a6eb30439e3fae5e91302c439d38a6dd2af43ea
7
+ data.tar.gz: 8ab3f3ba434d120046739ac51e971eafac912435544c27ee19c94f585bc0376ee609c566374605bfd7fb1d8ccb15ed07e3fb5feedbdf26d06c2015a248211880
data/CHANGES.md ADDED
@@ -0,0 +1,88 @@
1
+ ## [1.4.0] (2022-01-16)
2
+
3
+ [1.4.0]: https://github.com/RubyCrypto/ed25519/compare/v1.3.0...v1.4.0
4
+
5
+ - Use append_cflags instead of modifying CFLAGS directly ([#45])
6
+
7
+ [#45]: https://github.com/RubyCrypto/ed25519/pull/45
8
+
9
+ ## [1.3.0] (2022-01-16)
10
+
11
+ [1.3.0]: https://github.com/RubyCrypto/ed25519/compare/v1.2.4...v1.3.0
12
+
13
+ - Bump rubocop dependencies. ([#30])
14
+ - Add support for Ruby 3 & JRuby 9.3.0. ([#31])
15
+
16
+ [#30]: https://github.com/RubyCrypto/ed25519/pull/30
17
+ [#31]: https://github.com/RubyCrypto/ed25519/pull/31
18
+
19
+ ## [1.2.4] (2018-01-04)
20
+
21
+ [1.2.4]: https://github.com/RubyCrypto/ed25519/compare/v1.2.3...v1.2.4
22
+
23
+ * Fix JRuby platform name
24
+ * Add license information to gemspec
25
+
26
+ ## [1.2.3] (2017-12-31)
27
+
28
+ [1.2.3]: https://github.com/RubyCrypto/ed25519/compare/v1.2.2...v1.2.3
29
+
30
+ * [#18](https://github.com/RubyCrypto/ed25519/pull/18)
31
+ `ext/ed25519_ref10`: Consolidate fe.c and ge.c
32
+
33
+ ## [1.2.2] (2017-12-31)
34
+
35
+ [1.2.2]: https://github.com/RubyCrypto/ed25519/compare/v1.2.1...v1.2.2
36
+
37
+ * [#17](https://github.com/RubyCrypto/ed25519/pull/17)
38
+ Test against Ruby 2.5.0
39
+
40
+ * [#16](https://github.com/RubyCrypto/ed25519/pull/16)
41
+ Move project to the RubyCrypto GitHub organization
42
+
43
+ ## [1.2.1] (2017-12-15)
44
+
45
+ [1.2.1]: https://github.com/RubyCrypto/ed25519/compare/v1.2.0...v1.2.1
46
+
47
+ * [#14](https://github.com/RubyCrypto/ed25519/pull/14)
48
+ Support MRI 2.0+
49
+
50
+ ## [1.2.0] (2017-12-15)
51
+
52
+ [1.2.0]: https://github.com/RubyCrypto/ed25519/compare/v1.1.0...v1.2.0
53
+
54
+ * [#13](https://github.com/RubyCrypto/ed25519/pull/13)
55
+ Add `Ed25519::SigningKey.from_keypair`
56
+
57
+ * [#12](https://github.com/RubyCrypto/ed25519/pull/12)
58
+ Add `Ed25519.validate_key_bytes` method
59
+
60
+ ## [1.1.0] (2017-12-13)
61
+
62
+ [1.1.0]: https://github.com/RubyCrypto/ed25519/compare/v1.0.0...v1.1.0
63
+
64
+ * [#11](https://github.com/RubyCrypto/ed25519/pull/11)
65
+ ext/ed25519_java: switch to str4d/ed25519-java implementation (fixes #4)
66
+
67
+ * [#9](https://github.com/RubyCrypto/ed25519/pull/9)
68
+ Implement Java backend as a proper JRuby extension
69
+
70
+ * [#8](https://github.com/RubyCrypto/ed25519/pull/8)
71
+ Use an attr_accessor for Ed25519.provider
72
+
73
+ ## [1.0.0] (2017-12-12)
74
+
75
+ [1.0.0]: https://github.com/RubyCrypto/ed25519/compare/v0.1.0...v1.0.0
76
+
77
+ * [#7](https://github.com/RubyCrypto/ed25519/pull/7)
78
+ Keypair refactor
79
+
80
+ * [#6](https://github.com/RubyCrypto/ed25519/pull/6)
81
+ Switch from "ref" C implementation to SUPERCOP "ref10"
82
+
83
+ * [#5](https://github.com/RubyCrypto/ed25519/pull/5)
84
+ Raise Ed25519::VerifyError if signature verification fails
85
+
86
+ # 0.1.0 (2017-12-11)
87
+
88
+ * Initial release
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012-2025 Tony Arcieri
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,181 @@
1
+ # ed25519.rb [![Latest Version][gem-shield]][gem-link] [![Yard Docs][docs-image]][docs-link] [![License: MIT][license-image]][license-link] [![CI Status][ci-image]][ci-link]
2
+
3
+ [gem-shield]: https://img.shields.io/gem/v/ed25519?logo=ruby
4
+ [gem-link]: https://rubygems.org/gems/ed25519
5
+ [ci-image]: https://github.com/RubyCrypto/ed25519/workflows/CI/badge.svg
6
+ [ci-link]: https://github.com/RubyCrypto/ed25519/actions?query=workflow%3ACI+branch%3Amaster
7
+ [docs-image]: https://img.shields.io/badge/yard-docs-blue.svg
8
+ [docs-link]: http://www.rubydoc.info/gems/ed25519/1.4.0
9
+ [license-image]: https://img.shields.io/badge/license-MIT-blue.svg
10
+ [license-link]: https://github.com/RubyCrypto/ed25519/blob/master/LICENSE
11
+
12
+ A Ruby binding to the Ed25519 elliptic curve public-key signature system
13
+ described in [RFC 8032].
14
+
15
+ Two implementations are provided: a MRI C extension which uses the "ref10"
16
+ implementation from the SUPERCOP benchmark suite, and a pure Java version
17
+ based on [str4d/ed25519-java].
18
+
19
+ Ed25519 is one of two notable algorithms implemented atop the Curve25519
20
+ elliptic curve. The [x25519 gem] is a related project of this one,
21
+ and implements the X25519 Diffie-Hellman key exchange algorithm on the
22
+ Montgomery form of Curve25519.
23
+
24
+ [RFC 8032]: https://tools.ietf.org/html/rfc8032
25
+ [str4d/ed25519-java]: https://github.com/str4d/ed25519-java
26
+ [x25519 gem]: https://github.com/RubyCrypto/x25519
27
+
28
+ ## What is Ed25519?
29
+
30
+ Ed25519 is a modern implementation of a [Schnorr signature] system using
31
+ elliptic curve groups.
32
+
33
+ Ed25519 provides a 128-bit security level, that is to say, all known attacks
34
+ take at least 2^128 operations, providing the same security level as AES-128,
35
+ NIST P-256, and RSA-3072.
36
+
37
+ ![Ed25519 Diagram](https://raw.githubusercontent.com/RubyCrypto/ed25519/master/ed25519.png)
38
+
39
+ Ed25519 has a number of unique properties that make it one of the best-in-class
40
+ digital signature algorithms:
41
+
42
+ * ***Small keys***: Ed25519 keys are only 256-bits (32 bytes), making them
43
+ small enough to easily copy around. Ed25519 also allows the public key
44
+ to be derived from the private key, meaning that it doesn't need to be
45
+ included in a serialized private key in cases you want both.
46
+ * ***Small signatures***: Ed25519 signatures are only 512-bits (64 bytes),
47
+ one of the smallest signature sizes available.
48
+ * ***Deterministic***: Unlike (EC)DSA, Ed25519 does not rely on an entropy
49
+ source when signing messages. This can be a potential attack vector if
50
+ the entropy source is not generating good random numbers. Ed25519 avoids
51
+ this problem entirely and will always generate the same signature for the
52
+ same data.
53
+ * ***Collision Resistant***: Hash-function collisions do not break this
54
+ system. This adds a layer of defense against the possibility of weakness
55
+ in the selected hash function.
56
+
57
+ You can read more on [Dan Bernstein's Ed25519 site](http://ed25519.cr.yp.to/).
58
+
59
+ [Schnorr signature]: https://en.wikipedia.org/wiki/Schnorr_signature
60
+
61
+ ### Is it any good?
62
+
63
+ [Yes.](http://news.ycombinator.com/item?id=3067434)
64
+
65
+ ## Help and Discussion
66
+
67
+ Have questions? Want to suggest a feature or change? Join a discussion group:
68
+
69
+ * [Crypto.rb Gitter]: web-based chat about Ruby crypto projects including **ed25519**.
70
+ * [Crypto.rb Google Group]: join via web or email ([crypto-rb+subscribe@googlegroups.com])
71
+
72
+ [Crypto.rb Gitter]: https://gitter.im/crypto-rb/Lobby
73
+ [Crypto.rb Google Group]: https://groups.google.com/forum/#!forum/crypto-rb
74
+ [crypto-rb+subscribe@googlegroups.com]: mailto:crypto-rb+subscribe@googlegroups.com?subject=subscribe
75
+
76
+ ## Requirements
77
+
78
+ **ed25519.rb** is supported on and tested against the following platforms:
79
+
80
+ - MRI 3.0, 3.1, 3.2, 3.3, 3.4
81
+ - JRuby 9.4.12, 10.0.0
82
+
83
+ ## Installation
84
+
85
+ Add this line to your application's Gemfile:
86
+
87
+ gem 'ed25519'
88
+
89
+ And then execute:
90
+
91
+ $ bundle
92
+
93
+ Or install it yourself as:
94
+
95
+ $ gem install ed25519
96
+
97
+ # Usage
98
+
99
+ Require **ed25519.rb** in your Ruby program:
100
+
101
+ ```ruby
102
+ require "ed25519"
103
+ ```
104
+
105
+ Generate a new random signing key:
106
+
107
+ ```ruby
108
+ signing_key = Ed25519::SigningKey.generate
109
+ ```
110
+
111
+ Sign a message with the signing key:
112
+
113
+ ```ruby
114
+ signature = signing_key.sign(message)
115
+ ```
116
+
117
+ Obtain the verify key for a given signing key:
118
+
119
+ ```ruby
120
+ verify_key = signing_key.verify_key
121
+ ```
122
+
123
+ Check the validity of a signature:
124
+
125
+ ```ruby
126
+ verify_key.verify(signature, message)
127
+ ```
128
+
129
+ The verify method will return `true` if the signature verifies, or raise
130
+ `Ed25519::VerifyError` if verification fails.
131
+
132
+ ### Serializing Keys
133
+
134
+ Keys can be serialized as 32-byte binary strings as follows:
135
+
136
+ ```ruby
137
+ signature_key_bytes = signing_key.to_bytes
138
+ verify_key_bytes = verify_key.to_bytes
139
+ ```
140
+
141
+ The binary serialization can be passed directly into the constructor for a given key type:
142
+
143
+ ```ruby
144
+ signing_key = Ed25519::SigningKey.new(signature_key_bytes)
145
+ verify_key = Ed25519::VerifyKey.new(verify_key_bytes)
146
+ ```
147
+
148
+ ## Security Notes
149
+
150
+ The Ed25519 "ref10" implementation from SUPERCOP was lovingly crafted by expert
151
+ security boffins with great care taken to prevent timing attacks. The same
152
+ cannot be said for the C code used in the **ed25519.rb** C extension or in the
153
+ entirety of the provided Java implementation.
154
+
155
+ Care should be taken to avoid leaking to the attacker how long it takes to
156
+ generate keys or sign messages (at least until **ed25519.rb** itself can be audited
157
+ by experts who can fix any potential timing vulnerabilities)
158
+
159
+ **ed25519.rb** relies on a strong `SecureRandom` for key generation.
160
+ Weaknesses in the random number source can potentially result in insecure keys.
161
+
162
+ ## Contributing
163
+
164
+ Bug reports and pull requests are welcome on GitHub at https://github.com/RubyCrypto/ed25519.
165
+ This project is intended to be a safe, welcoming space for collaboration,
166
+ and contributors areexpected to adhere to the [Contributor Covenant](http://contributor-covenant.org)
167
+ code of conduct.
168
+
169
+ ## License
170
+
171
+ Copyright (c) 2012-2025 Tony Arcieri. Distributed under the MIT License. See
172
+ [LICENSE] for further details.
173
+
174
+ [LICENSE]: https://github.com/RubyCrypto/ed25519/blob/master/LICENSE
175
+
176
+ ## Code of Conduct
177
+
178
+ Everyone interacting in the **ed25519.rb** project’s codebases, issue trackers, chat
179
+ rooms and mailing lists is expected to follow the [code of conduct].
180
+
181
+ [code of conduct]: https://github.com/RubyCrypto/ed25519/blob/master/CODE_OF_CONDUCT.md
data/ed25519.png ADDED
Binary file
@@ -0,0 +1,123 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
122
+
123
+ For more information, please see https://creativecommons.org/publicdomain/zero/1.0/
@@ -0,0 +1,77 @@
1
+ EdDSA-Java
2
+ ==========
3
+
4
+ [![Build Status](https://travis-ci.org/str4d/ed25519-java.svg?branch=master)](https://travis-ci.org/str4d/ed25519-java)
5
+
6
+ This is an implementation of EdDSA in Java. Structurally, it is based on the ref10 implementation in SUPERCOP (see https://ed25519.cr.yp.to/software.html).
7
+
8
+ There are two internal implementations:
9
+ * A port of the radix-2^51 operations in ref10 - fast and constant-time, but only useful for Ed25519.
10
+ * A generic version using BigIntegers for calculation - a bit slower and not constant-time, but compatible with any EdDSA parameter specification.
11
+
12
+
13
+ To use
14
+ ------
15
+
16
+ Download the latest .jar from the releases tab and place it in your classpath.
17
+
18
+ Gradle users:
19
+
20
+ ```
21
+ compile 'net.i2p.crypto:eddsa:0.2.0'
22
+ ```
23
+
24
+ The code requires Java 6 (for e.g. the `Arrays.copyOfRange()` calls in `EdDSAEngine.engineVerify()`).
25
+
26
+ The JUnit4 tests require the Hamcrest library `hamcrest-all.jar`.
27
+
28
+ This code is released to the public domain and can be used for any purpose. See `LICENSE.txt` for details.
29
+
30
+ Disclaimer
31
+ ----------
32
+
33
+ There are **no** guarantees that this is secure for all cases, and users should
34
+ review the code themselves before depending on it. PRs that fix bugs or improve
35
+ reviewability are very welcome. Additionally:
36
+
37
+ - The unit test suite includes tests against
38
+ [the data from the original Python implementation](https://ed25519.cr.yp.to/python/sign.input).
39
+ - The code (as of 97cea3f0d910fc627c7b57b1bc4d783cdd0c2a4a) was reviewed by
40
+ [an independent developer](https://github.com/BloodyRookie).
41
+ - The code (as of dc9f58f2c874463c15465326efc040d17a627b3a) was audited by an independent third party,
42
+ and the one issue found [was fixed](https://github.com/str4d/ed25519-java/pull/31).
43
+
44
+ Code comparison
45
+ ---------------
46
+
47
+ For ease of following, here are the main methods in ref10 and their equivalents in this codebase:
48
+
49
+ | EdDSA Operation | ref10 function | Java function |
50
+ | --------------- | -------------- | ------------- |
51
+ | Generate keypair | `crypto_sign_keypair` | `EdDSAPrivateKeySpec` constructor |
52
+ | Sign message | `crypto_sign` | `EdDSAEngine.engineSign` |
53
+ | Verify signature | `crypto_sign_open` | `EdDSAEngine.engineVerify` |
54
+
55
+ | EdDSA point arithmetic | ref10 function | Java function |
56
+ | ---------------------- | -------------- | ------------- |
57
+ | `R = b * B` | `ge_scalarmult_base` | `GroupElement.scalarMultiply` |
58
+ | `R = a*A + b*B` | `ge_double_scalarmult_vartime` | `GroupElement.doubleScalarMultiplyVariableTime` |
59
+ | `R = 2 * P` | `ge_p2_dbl` | `GroupElement.dbl` |
60
+ | `R = P + Q` | `ge_madd`, `ge_add` | `GroupElement.madd`, `GroupElement.add` |
61
+ | `R = P - Q` | `ge_msub`, `ge_sub` | `GroupElement.msub`, `GroupElement.sub` |
62
+
63
+
64
+ Important changes
65
+ -----------------
66
+
67
+ ### 0.2.0
68
+
69
+ - Ed25519 is now named `Ed25519` in `EdDSANamedCurveTable`, and the previous public constant
70
+ (containing the older inaccurate name) has been removed.
71
+
72
+ Credits
73
+ -------
74
+
75
+ * The Ed25519 class was originally ported by k3d3 from [the Python Ed25519 reference implementation](https://ed25519.cr.yp.to/python/ed25519.py).
76
+ * Useful comments and tweaks were found in [the GNUnet implementation of Ed25519](https://gnunet.org/svn/gnunet-java/src/main/java/org/gnunet/util/crypto/) (based on k3d3's class).
77
+ * [BloodyRookie](https://github.com/BloodyRookie) reviewed the code, adding many useful comments, unit tests and literature.