argon2 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +2 -2
  3. data/Steepfile +1 -1
  4. data/argon2.gemspec +1 -1
  5. data/lib/argon2/version.rb +1 -1
  6. metadata +5 -88
  7. data/ext/argon2_wrap/argon_wrap.o +0 -0
  8. data/ext/phc-winner-argon2/.git +0 -1
  9. data/ext/phc-winner-argon2/.gitattributes +0 -10
  10. data/ext/phc-winner-argon2/.gitignore +0 -22
  11. data/ext/phc-winner-argon2/.travis.yml +0 -25
  12. data/ext/phc-winner-argon2/Argon2.sln +0 -158
  13. data/ext/phc-winner-argon2/CHANGELOG.md +0 -32
  14. data/ext/phc-winner-argon2/LICENSE +0 -314
  15. data/ext/phc-winner-argon2/Makefile +0 -255
  16. data/ext/phc-winner-argon2/Package.swift +0 -46
  17. data/ext/phc-winner-argon2/README.md +0 -303
  18. data/ext/phc-winner-argon2/appveyor.yml +0 -25
  19. data/ext/phc-winner-argon2/argon2-specs.pdf +0 -0
  20. data/ext/phc-winner-argon2/export.sh +0 -7
  21. data/ext/phc-winner-argon2/include/argon2.h +0 -437
  22. data/ext/phc-winner-argon2/kats/argon2d +0 -12304
  23. data/ext/phc-winner-argon2/kats/argon2d.shasum +0 -1
  24. data/ext/phc-winner-argon2/kats/argon2d_v16 +0 -12304
  25. data/ext/phc-winner-argon2/kats/argon2d_v16.shasum +0 -1
  26. data/ext/phc-winner-argon2/kats/argon2i +0 -12304
  27. data/ext/phc-winner-argon2/kats/argon2i.shasum +0 -1
  28. data/ext/phc-winner-argon2/kats/argon2i_v16 +0 -12304
  29. data/ext/phc-winner-argon2/kats/argon2i_v16.shasum +0 -1
  30. data/ext/phc-winner-argon2/kats/argon2id +0 -12304
  31. data/ext/phc-winner-argon2/kats/argon2id.shasum +0 -1
  32. data/ext/phc-winner-argon2/kats/argon2id_v16 +0 -12304
  33. data/ext/phc-winner-argon2/kats/argon2id_v16.shasum +0 -1
  34. data/ext/phc-winner-argon2/kats/check-sums.ps1 +0 -42
  35. data/ext/phc-winner-argon2/kats/check-sums.sh +0 -13
  36. data/ext/phc-winner-argon2/kats/test.ps1 +0 -50
  37. data/ext/phc-winner-argon2/kats/test.sh +0 -49
  38. data/ext/phc-winner-argon2/latex/IEEEtran.cls +0 -6347
  39. data/ext/phc-winner-argon2/latex/Makefile +0 -18
  40. data/ext/phc-winner-argon2/latex/argon2-specs.tex +0 -920
  41. data/ext/phc-winner-argon2/latex/pics/argon2-par.pdf +0 -0
  42. data/ext/phc-winner-argon2/latex/pics/compression.pdf +0 -0
  43. data/ext/phc-winner-argon2/latex/pics/generic.pdf +0 -0
  44. data/ext/phc-winner-argon2/latex/pics/power-distribution.jpg +0 -0
  45. data/ext/phc-winner-argon2/latex/tradeoff.bib +0 -822
  46. data/ext/phc-winner-argon2/libargon2.pc.in +0 -18
  47. data/ext/phc-winner-argon2/man/argon2.1 +0 -57
  48. data/ext/phc-winner-argon2/src/argon2.c +0 -452
  49. data/ext/phc-winner-argon2/src/bench.c +0 -111
  50. data/ext/phc-winner-argon2/src/blake2/blake2-impl.h +0 -156
  51. data/ext/phc-winner-argon2/src/blake2/blake2.h +0 -89
  52. data/ext/phc-winner-argon2/src/blake2/blake2b.c +0 -390
  53. data/ext/phc-winner-argon2/src/blake2/blamka-round-opt.h +0 -471
  54. data/ext/phc-winner-argon2/src/blake2/blamka-round-ref.h +0 -56
  55. data/ext/phc-winner-argon2/src/core.c +0 -648
  56. data/ext/phc-winner-argon2/src/core.h +0 -228
  57. data/ext/phc-winner-argon2/src/encoding.c +0 -463
  58. data/ext/phc-winner-argon2/src/encoding.h +0 -57
  59. data/ext/phc-winner-argon2/src/genkat.c +0 -213
  60. data/ext/phc-winner-argon2/src/genkat.h +0 -51
  61. data/ext/phc-winner-argon2/src/opt.c +0 -283
  62. data/ext/phc-winner-argon2/src/ref.c +0 -194
  63. data/ext/phc-winner-argon2/src/run.c +0 -337
  64. data/ext/phc-winner-argon2/src/test.c +0 -289
  65. data/ext/phc-winner-argon2/src/thread.c +0 -57
  66. data/ext/phc-winner-argon2/src/thread.h +0 -67
  67. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +0 -231
  68. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +0 -69
  69. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +0 -231
  70. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +0 -69
  71. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +0 -230
  72. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +0 -66
  73. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +0 -244
  74. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +0 -72
  75. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +0 -235
  76. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +0 -69
  77. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +0 -243
  78. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +0 -69
  79. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +0 -231
  80. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +0 -69
  81. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +0 -230
  82. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +0 -66
  83. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +0 -232
  84. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +0 -72
  85. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +0 -231
  86. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +0 -69
@@ -1,314 +0,0 @@
1
- Argon2 reference source code package - reference C implementations
2
-
3
- Copyright 2015
4
- Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
5
-
6
- You may use this work under the terms of a Creative Commons CC0 1.0
7
- License/Waiver or the Apache Public License 2.0, at your option. The terms of
8
- these licenses can be found at:
9
-
10
- - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
11
- - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
12
-
13
- The terms of the licenses are reproduced below.
14
-
15
- --------------------------------------------------------------------------------
16
-
17
- Creative Commons Legal Code
18
-
19
- CC0 1.0 Universal
20
-
21
- CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
22
- LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
23
- ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
24
- INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
25
- REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
26
- PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
27
- THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
28
- HEREUNDER.
29
-
30
- Statement of Purpose
31
-
32
- The laws of most jurisdictions throughout the world automatically confer
33
- exclusive Copyright and Related Rights (defined below) upon the creator
34
- and subsequent owner(s) (each and all, an "owner") of an original work of
35
- authorship and/or a database (each, a "Work").
36
-
37
- Certain owners wish to permanently relinquish those rights to a Work for
38
- the purpose of contributing to a commons of creative, cultural and
39
- scientific works ("Commons") that the public can reliably and without fear
40
- of later claims of infringement build upon, modify, incorporate in other
41
- works, reuse and redistribute as freely as possible in any form whatsoever
42
- and for any purposes, including without limitation commercial purposes.
43
- These owners may contribute to the Commons to promote the ideal of a free
44
- culture and the further production of creative, cultural and scientific
45
- works, or to gain reputation or greater distribution for their Work in
46
- part through the use and efforts of others.
47
-
48
- For these and/or other purposes and motivations, and without any
49
- expectation of additional consideration or compensation, the person
50
- associating CC0 with a Work (the "Affirmer"), to the extent that he or she
51
- is an owner of Copyright and Related Rights in the Work, voluntarily
52
- elects to apply CC0 to the Work and publicly distribute the Work under its
53
- terms, with knowledge of his or her Copyright and Related Rights in the
54
- Work and the meaning and intended legal effect of CC0 on those rights.
55
-
56
- 1. Copyright and Related Rights. A Work made available under CC0 may be
57
- protected by copyright and related or neighboring rights ("Copyright and
58
- Related Rights"). Copyright and Related Rights include, but are not
59
- limited to, the following:
60
-
61
- i. the right to reproduce, adapt, distribute, perform, display,
62
- communicate, and translate a Work;
63
- ii. moral rights retained by the original author(s) and/or performer(s);
64
- iii. publicity and privacy rights pertaining to a person's image or
65
- likeness depicted in a Work;
66
- iv. rights protecting against unfair competition in regards to a Work,
67
- subject to the limitations in paragraph 4(a), below;
68
- v. rights protecting the extraction, dissemination, use and reuse of data
69
- in a Work;
70
- vi. database rights (such as those arising under Directive 96/9/EC of the
71
- European Parliament and of the Council of 11 March 1996 on the legal
72
- protection of databases, and under any national implementation
73
- thereof, including any amended or successor version of such
74
- directive); and
75
- vii. other similar, equivalent or corresponding rights throughout the
76
- world based on applicable law or treaty, and any national
77
- implementations thereof.
78
-
79
- 2. Waiver. To the greatest extent permitted by, but not in contravention
80
- of, applicable law, Affirmer hereby overtly, fully, permanently,
81
- irrevocably and unconditionally waives, abandons, and surrenders all of
82
- Affirmer's Copyright and Related Rights and associated claims and causes
83
- of action, whether now known or unknown (including existing as well as
84
- future claims and causes of action), in the Work (i) in all territories
85
- worldwide, (ii) for the maximum duration provided by applicable law or
86
- treaty (including future time extensions), (iii) in any current or future
87
- medium and for any number of copies, and (iv) for any purpose whatsoever,
88
- including without limitation commercial, advertising or promotional
89
- purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
90
- member of the public at large and to the detriment of Affirmer's heirs and
91
- successors, fully intending that such Waiver shall not be subject to
92
- revocation, rescission, cancellation, termination, or any other legal or
93
- equitable action to disrupt the quiet enjoyment of the Work by the public
94
- as contemplated by Affirmer's express Statement of Purpose.
95
-
96
- 3. Public License Fallback. Should any part of the Waiver for any reason
97
- be judged legally invalid or ineffective under applicable law, then the
98
- Waiver shall be preserved to the maximum extent permitted taking into
99
- account Affirmer's express Statement of Purpose. In addition, to the
100
- extent the Waiver is so judged Affirmer hereby grants to each affected
101
- person a royalty-free, non transferable, non sublicensable, non exclusive,
102
- irrevocable and unconditional license to exercise Affirmer's Copyright and
103
- Related Rights in the Work (i) in all territories worldwide, (ii) for the
104
- maximum duration provided by applicable law or treaty (including future
105
- time extensions), (iii) in any current or future medium and for any number
106
- of copies, and (iv) for any purpose whatsoever, including without
107
- limitation commercial, advertising or promotional purposes (the
108
- "License"). The License shall be deemed effective as of the date CC0 was
109
- applied by Affirmer to the Work. Should any part of the License for any
110
- reason be judged legally invalid or ineffective under applicable law, such
111
- partial invalidity or ineffectiveness shall not invalidate the remainder
112
- of the License, and in such case Affirmer hereby affirms that he or she
113
- will not (i) exercise any of his or her remaining Copyright and Related
114
- Rights in the Work or (ii) assert any associated claims and causes of
115
- action with respect to the Work, in either case contrary to Affirmer's
116
- express Statement of Purpose.
117
-
118
- 4. Limitations and Disclaimers.
119
-
120
- a. No trademark or patent rights held by Affirmer are waived, abandoned,
121
- surrendered, licensed or otherwise affected by this document.
122
- b. Affirmer offers the Work as-is and makes no representations or
123
- warranties of any kind concerning the Work, express, implied,
124
- statutory or otherwise, including without limitation warranties of
125
- title, merchantability, fitness for a particular purpose, non
126
- infringement, or the absence of latent or other defects, accuracy, or
127
- the present or absence of errors, whether or not discoverable, all to
128
- the greatest extent permissible under applicable law.
129
- c. Affirmer disclaims responsibility for clearing rights of other persons
130
- that may apply to the Work or any use thereof, including without
131
- limitation any person's Copyright and Related Rights in the Work.
132
- Further, Affirmer disclaims responsibility for obtaining any necessary
133
- consents, permissions or other rights required for any use of the
134
- Work.
135
- d. Affirmer understands and acknowledges that Creative Commons is not a
136
- party to this document and has no duty or obligation with respect to
137
- this CC0 or use of the Work.
138
-
139
- --------------------------------------------------------------------------------
140
-
141
- Apache License
142
- Version 2.0, January 2004
143
- http://www.apache.org/licenses/
144
-
145
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
146
-
147
- 1. Definitions.
148
-
149
- "License" shall mean the terms and conditions for use, reproduction,
150
- and distribution as defined by Sections 1 through 9 of this document.
151
-
152
- "Licensor" shall mean the copyright owner or entity authorized by
153
- the copyright owner that is granting the License.
154
-
155
- "Legal Entity" shall mean the union of the acting entity and all
156
- other entities that control, are controlled by, or are under common
157
- control with that entity. For the purposes of this definition,
158
- "control" means (i) the power, direct or indirect, to cause the
159
- direction or management of such entity, whether by contract or
160
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
161
- outstanding shares, or (iii) beneficial ownership of such entity.
162
-
163
- "You" (or "Your") shall mean an individual or Legal Entity
164
- exercising permissions granted by this License.
165
-
166
- "Source" form shall mean the preferred form for making modifications,
167
- including but not limited to software source code, documentation
168
- source, and configuration files.
169
-
170
- "Object" form shall mean any form resulting from mechanical
171
- transformation or translation of a Source form, including but
172
- not limited to compiled object code, generated documentation,
173
- and conversions to other media types.
174
-
175
- "Work" shall mean the work of authorship, whether in Source or
176
- Object form, made available under the License, as indicated by a
177
- copyright notice that is included in or attached to the work
178
- (an example is provided in the Appendix below).
179
-
180
- "Derivative Works" shall mean any work, whether in Source or Object
181
- form, that is based on (or derived from) the Work and for which the
182
- editorial revisions, annotations, elaborations, or other modifications
183
- represent, as a whole, an original work of authorship. For the purposes
184
- of this License, Derivative Works shall not include works that remain
185
- separable from, or merely link (or bind by name) to the interfaces of,
186
- the Work and Derivative Works thereof.
187
-
188
- "Contribution" shall mean any work of authorship, including
189
- the original version of the Work and any modifications or additions
190
- to that Work or Derivative Works thereof, that is intentionally
191
- submitted to Licensor for inclusion in the Work by the copyright owner
192
- or by an individual or Legal Entity authorized to submit on behalf of
193
- the copyright owner. For the purposes of this definition, "submitted"
194
- means any form of electronic, verbal, or written communication sent
195
- to the Licensor or its representatives, including but not limited to
196
- communication on electronic mailing lists, source code control systems,
197
- and issue tracking systems that are managed by, or on behalf of, the
198
- Licensor for the purpose of discussing and improving the Work, but
199
- excluding communication that is conspicuously marked or otherwise
200
- designated in writing by the copyright owner as "Not a Contribution."
201
-
202
- "Contributor" shall mean Licensor and any individual or Legal Entity
203
- on behalf of whom a Contribution has been received by Licensor and
204
- subsequently incorporated within the Work.
205
-
206
- 2. Grant of Copyright License. Subject to the terms and conditions of
207
- this License, each Contributor hereby grants to You a perpetual,
208
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
209
- copyright license to reproduce, prepare Derivative Works of,
210
- publicly display, publicly perform, sublicense, and distribute the
211
- Work and such Derivative Works in Source or Object form.
212
-
213
- 3. Grant of Patent License. Subject to the terms and conditions of
214
- this License, each Contributor hereby grants to You a perpetual,
215
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
216
- (except as stated in this section) patent license to make, have made,
217
- use, offer to sell, sell, import, and otherwise transfer the Work,
218
- where such license applies only to those patent claims licensable
219
- by such Contributor that are necessarily infringed by their
220
- Contribution(s) alone or by combination of their Contribution(s)
221
- with the Work to which such Contribution(s) was submitted. If You
222
- institute patent litigation against any entity (including a
223
- cross-claim or counterclaim in a lawsuit) alleging that the Work
224
- or a Contribution incorporated within the Work constitutes direct
225
- or contributory patent infringement, then any patent licenses
226
- granted to You under this License for that Work shall terminate
227
- as of the date such litigation is filed.
228
-
229
- 4. Redistribution. You may reproduce and distribute copies of the
230
- Work or Derivative Works thereof in any medium, with or without
231
- modifications, and in Source or Object form, provided that You
232
- meet the following conditions:
233
-
234
- (a) You must give any other recipients of the Work or
235
- Derivative Works a copy of this License; and
236
-
237
- (b) You must cause any modified files to carry prominent notices
238
- stating that You changed the files; and
239
-
240
- (c) You must retain, in the Source form of any Derivative Works
241
- that You distribute, all copyright, patent, trademark, and
242
- attribution notices from the Source form of the Work,
243
- excluding those notices that do not pertain to any part of
244
- the Derivative Works; and
245
-
246
- (d) If the Work includes a "NOTICE" text file as part of its
247
- distribution, then any Derivative Works that You distribute must
248
- include a readable copy of the attribution notices contained
249
- within such NOTICE file, excluding those notices that do not
250
- pertain to any part of the Derivative Works, in at least one
251
- of the following places: within a NOTICE text file distributed
252
- as part of the Derivative Works; within the Source form or
253
- documentation, if provided along with the Derivative Works; or,
254
- within a display generated by the Derivative Works, if and
255
- wherever such third-party notices normally appear. The contents
256
- of the NOTICE file are for informational purposes only and
257
- do not modify the License. You may add Your own attribution
258
- notices within Derivative Works that You distribute, alongside
259
- or as an addendum to the NOTICE text from the Work, provided
260
- that such additional attribution notices cannot be construed
261
- as modifying the License.
262
-
263
- You may add Your own copyright statement to Your modifications and
264
- may provide additional or different license terms and conditions
265
- for use, reproduction, or distribution of Your modifications, or
266
- for any such Derivative Works as a whole, provided Your use,
267
- reproduction, and distribution of the Work otherwise complies with
268
- the conditions stated in this License.
269
-
270
- 5. Submission of Contributions. Unless You explicitly state otherwise,
271
- any Contribution intentionally submitted for inclusion in the Work
272
- by You to the Licensor shall be under the terms and conditions of
273
- this License, without any additional terms or conditions.
274
- Notwithstanding the above, nothing herein shall supersede or modify
275
- the terms of any separate license agreement you may have executed
276
- with Licensor regarding such Contributions.
277
-
278
- 6. Trademarks. This License does not grant permission to use the trade
279
- names, trademarks, service marks, or product names of the Licensor,
280
- except as required for reasonable and customary use in describing the
281
- origin of the Work and reproducing the content of the NOTICE file.
282
-
283
- 7. Disclaimer of Warranty. Unless required by applicable law or
284
- agreed to in writing, Licensor provides the Work (and each
285
- Contributor provides its Contributions) on an "AS IS" BASIS,
286
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
287
- implied, including, without limitation, any warranties or conditions
288
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
289
- PARTICULAR PURPOSE. You are solely responsible for determining the
290
- appropriateness of using or redistributing the Work and assume any
291
- risks associated with Your exercise of permissions under this License.
292
-
293
- 8. Limitation of Liability. In no event and under no legal theory,
294
- whether in tort (including negligence), contract, or otherwise,
295
- unless required by applicable law (such as deliberate and grossly
296
- negligent acts) or agreed to in writing, shall any Contributor be
297
- liable to You for damages, including any direct, indirect, special,
298
- incidental, or consequential damages of any character arising as a
299
- result of this License or out of the use or inability to use the
300
- Work (including but not limited to damages for loss of goodwill,
301
- work stoppage, computer failure or malfunction, or any and all
302
- other commercial damages or losses), even if such Contributor
303
- has been advised of the possibility of such damages.
304
-
305
- 9. Accepting Warranty or Additional Liability. While redistributing
306
- the Work or Derivative Works thereof, You may choose to offer,
307
- and charge a fee for, acceptance of support, warranty, indemnity,
308
- or other liability obligations and/or rights consistent with this
309
- License. However, in accepting such obligations, You may act only
310
- on Your own behalf and on Your sole responsibility, not on behalf
311
- of any other Contributor, and only if You agree to indemnify,
312
- defend, and hold each Contributor harmless for any liability
313
- incurred by, or claims asserted against, such Contributor by reason
314
- of your accepting any such warranty or additional liability.
@@ -1,255 +0,0 @@
1
- #
2
- # Argon2 reference source code package - reference C implementations
3
- #
4
- # Copyright 2015
5
- # Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
6
- #
7
- # You may use this work under the terms of a Creative Commons CC0 1.0
8
- # License/Waiver or the Apache Public License 2.0, at your option. The terms of
9
- # these licenses can be found at:
10
- #
11
- # - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
12
- # - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # You should have received a copy of both of these licenses along with this
15
- # software. If not, they may be obtained at the above URLs.
16
- #
17
-
18
- RUN = argon2
19
- BENCH = bench
20
- GENKAT = genkat
21
- ARGON2_VERSION ?= ZERO
22
-
23
- # installation parameters for staging area and final installation path
24
- # Note; if Linux and not Debian/Ubuntu version also add lib override to make command-line
25
- # for RedHat/Fedora, add: LIBRARY_REL=lib64
26
- DESTDIR ?=
27
- PREFIX ?= /usr
28
-
29
- # Increment on an ABI breaking change
30
- ABI_VERSION = 1
31
-
32
- DIST = phc-winner-argon2
33
-
34
- SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c
35
- SRC_RUN = src/run.c
36
- SRC_BENCH = src/bench.c
37
- SRC_GENKAT = src/genkat.c
38
- OBJ = $(SRC:.c=.o)
39
-
40
- CFLAGS += -std=c89 -O3 -Wall -g -Iinclude -Isrc
41
-
42
- ifeq ($(NO_THREADS), 1)
43
- CFLAGS += -DARGON2_NO_THREADS
44
- else
45
- CFLAGS += -pthread
46
- endif
47
-
48
- CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \
49
- -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM
50
-
51
- OPTTARGET ?= native
52
- OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \
53
- -o /dev/null 2>/dev/null; echo $$?)
54
- # Detect compatible platform
55
- ifneq ($(OPTTEST), 0)
56
- $(info Building without optimizations)
57
- SRC += src/ref.c
58
- else
59
- $(info Building with optimizations for $(OPTTARGET))
60
- CFLAGS += -march=$(OPTTARGET)
61
- SRC += src/opt.c
62
- endif
63
-
64
- BUILD_PATH := $(shell pwd)
65
- KERNEL_NAME := $(shell uname -s)
66
- MACHINE_NAME := $(shell uname -m)
67
-
68
- LIB_NAME = argon2
69
- PC_NAME = lib$(LIB_NAME).pc
70
- PC_SRC = $(PC_NAME).in
71
-
72
- ifeq ($(KERNEL_NAME), Linux)
73
- LIB_EXT := so.$(ABI_VERSION)
74
- LIB_CFLAGS := -shared -fPIC -fvisibility=hidden -DA2_VISCTL=1
75
- SO_LDFLAGS := -Wl,-soname,lib$(LIB_NAME).$(LIB_EXT)
76
- LINKED_LIB_EXT := so
77
- PC_EXTRA_LIBS ?= -lrt -ldl
78
- endif
79
- ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),DragonFly FreeBSD NetBSD OpenBSD))
80
- LIB_EXT := so
81
- LIB_CFLAGS := -shared -fPIC
82
- PC_EXTRA_LIBS ?=
83
- endif
84
- ifeq ($(KERNEL_NAME), Darwin)
85
- LIB_EXT := $(ABI_VERSION).dylib
86
- LIB_CFLAGS = -dynamiclib -install_name $(PREFIX)/$(LIBRARY_REL)/lib$(LIB_NAME).$(LIB_EXT)
87
- LINKED_LIB_EXT := dylib
88
- PC_EXTRA_LIBS ?=
89
- endif
90
- ifeq ($(findstring CYGWIN, $(KERNEL_NAME)), CYGWIN)
91
- LIB_EXT := dll
92
- LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a
93
- PC_EXTRA_LIBS ?=
94
- endif
95
- ifeq ($(findstring MINGW, $(KERNEL_NAME)), MINGW)
96
- LIB_EXT := dll
97
- LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a
98
- PC_EXTRA_LIBS ?=
99
- endif
100
- ifeq ($(findstring MSYS, $(KERNEL_NAME)), MSYS)
101
- LIB_EXT := dll
102
- LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a
103
- PC_EXTRA_LIBS ?=
104
- endif
105
- ifeq ($(KERNEL_NAME), SunOS)
106
- CC := gcc
107
- CFLAGS += -D_REENTRANT
108
- LIB_EXT := so
109
- LIB_CFLAGS := -shared -fPIC
110
- PC_EXTRA_LIBS ?=
111
- endif
112
-
113
- ifeq ($(KERNEL_NAME), Linux)
114
- ifeq ($(CC), clang)
115
- CI_CFLAGS += -fsanitize=address -fsanitize=undefined
116
- endif
117
- endif
118
-
119
- LIB_SH := lib$(LIB_NAME).$(LIB_EXT)
120
- LIB_ST := lib$(LIB_NAME).a
121
-
122
- ifdef LINKED_LIB_EXT
123
- LINKED_LIB_SH := lib$(LIB_NAME).$(LINKED_LIB_EXT)
124
- endif
125
-
126
- # Some systems don't provide an unprefixed ar when cross-compiling.
127
- AR=ar
128
-
129
- LIBRARIES = $(LIB_SH) $(LIB_ST)
130
- HEADERS = include/argon2.h
131
-
132
- INSTALL = install
133
-
134
- # relative paths for different OS
135
- ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),DragonFly FreeBSD))
136
-
137
- # default for FreeBSD
138
- BINARY_REL ?= bin
139
- INCLUDE_REL ?= include
140
- LIBRARY_REL ?= lib
141
- PKGCONFIG_REL ?= libdata
142
-
143
- else ifeq ($(KERNEL_NAME)-$(MACHINE_NAME), Linux-x86_64)
144
-
145
- # default for Debian/Ubuntu x86_64
146
- BINARY_REL ?= bin
147
- INCLUDE_REL ?= include
148
- LIBRARY_REL ?= lib/x86_64-linux-gnu
149
- PKGCONFIG_REL ?= $(LIBRARY_REL)
150
-
151
- else
152
-
153
- # NetBSD, ... and Linux64/Linux32 variants that use plain lib directory
154
- BINARY_REL ?= bin
155
- INCLUDE_REL ?= include
156
- LIBRARY_REL ?= lib
157
- PKGCONFIG_REL ?= $(LIBRARY_REL)
158
-
159
- endif
160
-
161
- # absolute paths to staging area
162
- INST_INCLUDE = $(DESTDIR)$(PREFIX)/$(INCLUDE_REL)
163
- INST_LIBRARY = $(DESTDIR)$(PREFIX)/$(LIBRARY_REL)
164
- INST_BINARY = $(DESTDIR)$(PREFIX)/$(BINARY_REL)
165
- INST_PKGCONFIG = $(DESTDIR)$(PREFIX)/$(PKGCONFIG_REL)/pkgconfig
166
-
167
- # main target
168
- .PHONY: all
169
- all: $(RUN) libs
170
-
171
- .PHONY: libs
172
- libs: $(LIBRARIES) $(PC_NAME)
173
-
174
- $(RUN): $(SRC) $(SRC_RUN)
175
- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
176
-
177
- $(BENCH): $(SRC) $(SRC_BENCH)
178
- $(CC) $(CFLAGS) $^ -o $@
179
-
180
- $(GENKAT): $(SRC) $(SRC_GENKAT)
181
- $(CC) $(CFLAGS) $^ -o $@ -DGENKAT
182
-
183
- $(LIB_SH): $(SRC)
184
- $(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@
185
-
186
- $(LIB_ST): $(OBJ)
187
- $(AR) rcs $@ $^
188
-
189
- .PHONY: clean
190
- clean:
191
- rm -f '$(RUN)' '$(BENCH)' '$(GENKAT)'
192
- rm -f '$(LIB_SH)' '$(LIB_ST)' kat-argon2* '$(PC_NAME)'
193
- rm -f testcase
194
- rm -rf *.dSYM
195
- cd src/ && rm -f *.o
196
- cd src/blake2/ && rm -f *.o
197
- cd kats/ && rm -f kat-* diff* run_* make_*
198
-
199
-
200
- # all substitutions to pc template
201
- SED_COMMANDS = /^\#\#.*$$/d;
202
- SED_COMMANDS += s\#@PREFIX@\#$(PREFIX)\#g;
203
- SED_COMMANDS += s\#@EXTRA_LIBS@\#$(PC_EXTRA_LIBS)\#g;
204
- SED_COMMANDS += s\#@UPSTREAM_VER@\#$(ARGON2_VERSION)\#g;
205
- SED_COMMANDS += s\#@HOST_MULTIARCH@\#$(LIBRARY_REL)\#g;
206
- SED_COMMANDS += s\#@INCLUDE@\#$(INCLUDE_REL)\#g;
207
-
208
- # substitute PREFIX and PC_EXTRA_LIBS into pkgconfig pc file
209
- $(PC_NAME): $(PC_SRC)
210
- sed '$(SED_COMMANDS)' < '$(PC_SRC)' > '$@'
211
-
212
-
213
- .PHONY: dist
214
- dist:
215
- cd ..; \
216
- tar -c --exclude='.??*' -z -f $(DIST)-`date "+%Y%m%d"`.tgz $(DIST)/*
217
-
218
- .PHONY: test
219
- test: $(SRC) src/test.c
220
- $(CC) $(CFLAGS) -Wextra -Wno-type-limits $^ -o testcase
221
- @sh kats/test.sh
222
- ./testcase
223
-
224
- .PHONY: testci
225
- testci: $(SRC) src/test.c
226
- $(CC) $(CI_CFLAGS) $^ -o testcase
227
- @sh kats/test.sh
228
- ./testcase
229
-
230
-
231
- .PHONY: format
232
- format:
233
- clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4}" \
234
- -i include/*.h src/*.c src/*.h src/blake2/*.c src/blake2/*.h
235
-
236
- .PHONY: install
237
- install: $(RUN) libs
238
- $(INSTALL) -d $(INST_INCLUDE)
239
- $(INSTALL) -m 0644 $(HEADERS) $(INST_INCLUDE)
240
- $(INSTALL) -d $(INST_LIBRARY)
241
- $(INSTALL) -m 0644 $(LIBRARIES) $(INST_LIBRARY)
242
- ifdef LINKED_LIB_SH
243
- cd $(INST_LIBRARY) && ln -sf $(notdir $(LIB_SH) $(LINKED_LIB_SH))
244
- endif
245
- $(INSTALL) -d $(INST_BINARY)
246
- $(INSTALL) $(RUN) $(INST_BINARY)
247
- $(INSTALL) -d $(INST_PKGCONFIG)
248
- $(INSTALL) -m 0644 $(PC_NAME) $(INST_PKGCONFIG)
249
-
250
- .PHONY: uninstall
251
- uninstall:
252
- cd $(INST_INCLUDE) && rm -f $(notdir $(HEADERS))
253
- cd $(INST_LIBRARY) && rm -f $(notdir $(LIBRARIES) $(LINKED_LIB_SH))
254
- cd $(INST_BINARY) && rm -f $(notdir $(RUN))
255
- cd $(INST_PKG_CONFIG) && rm -f $(notdir $(PC_NAME))
@@ -1,46 +0,0 @@
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
- )