argon2 2.2.0 → 2.3.1

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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +2 -2
  3. data/README.md +35 -8
  4. data/Steepfile +1 -1
  5. data/argon2.gemspec +1 -1
  6. data/lib/argon2/profiles.rb +50 -0
  7. data/lib/argon2/version.rb +1 -1
  8. data/lib/argon2.rb +27 -7
  9. data/sig/argon2.rbs +29 -9
  10. data/sig/engine.rbs +9 -0
  11. data/sig/errors.rbs +6 -0
  12. data/sig/ffi.rbs +3 -3
  13. data/sig/hash_format.rbs +31 -0
  14. metadata +9 -88
  15. data/ext/argon2_wrap/argon_wrap.o +0 -0
  16. data/ext/phc-winner-argon2/.git +0 -1
  17. data/ext/phc-winner-argon2/.gitattributes +0 -10
  18. data/ext/phc-winner-argon2/.gitignore +0 -22
  19. data/ext/phc-winner-argon2/.travis.yml +0 -25
  20. data/ext/phc-winner-argon2/Argon2.sln +0 -158
  21. data/ext/phc-winner-argon2/CHANGELOG.md +0 -32
  22. data/ext/phc-winner-argon2/LICENSE +0 -314
  23. data/ext/phc-winner-argon2/Makefile +0 -255
  24. data/ext/phc-winner-argon2/Package.swift +0 -46
  25. data/ext/phc-winner-argon2/README.md +0 -303
  26. data/ext/phc-winner-argon2/appveyor.yml +0 -25
  27. data/ext/phc-winner-argon2/argon2-specs.pdf +0 -0
  28. data/ext/phc-winner-argon2/export.sh +0 -7
  29. data/ext/phc-winner-argon2/include/argon2.h +0 -437
  30. data/ext/phc-winner-argon2/kats/argon2d +0 -12304
  31. data/ext/phc-winner-argon2/kats/argon2d.shasum +0 -1
  32. data/ext/phc-winner-argon2/kats/argon2d_v16 +0 -12304
  33. data/ext/phc-winner-argon2/kats/argon2d_v16.shasum +0 -1
  34. data/ext/phc-winner-argon2/kats/argon2i +0 -12304
  35. data/ext/phc-winner-argon2/kats/argon2i.shasum +0 -1
  36. data/ext/phc-winner-argon2/kats/argon2i_v16 +0 -12304
  37. data/ext/phc-winner-argon2/kats/argon2i_v16.shasum +0 -1
  38. data/ext/phc-winner-argon2/kats/argon2id +0 -12304
  39. data/ext/phc-winner-argon2/kats/argon2id.shasum +0 -1
  40. data/ext/phc-winner-argon2/kats/argon2id_v16 +0 -12304
  41. data/ext/phc-winner-argon2/kats/argon2id_v16.shasum +0 -1
  42. data/ext/phc-winner-argon2/kats/check-sums.ps1 +0 -42
  43. data/ext/phc-winner-argon2/kats/check-sums.sh +0 -13
  44. data/ext/phc-winner-argon2/kats/test.ps1 +0 -50
  45. data/ext/phc-winner-argon2/kats/test.sh +0 -49
  46. data/ext/phc-winner-argon2/latex/IEEEtran.cls +0 -6347
  47. data/ext/phc-winner-argon2/latex/Makefile +0 -18
  48. data/ext/phc-winner-argon2/latex/argon2-specs.tex +0 -920
  49. data/ext/phc-winner-argon2/latex/pics/argon2-par.pdf +0 -0
  50. data/ext/phc-winner-argon2/latex/pics/compression.pdf +0 -0
  51. data/ext/phc-winner-argon2/latex/pics/generic.pdf +0 -0
  52. data/ext/phc-winner-argon2/latex/pics/power-distribution.jpg +0 -0
  53. data/ext/phc-winner-argon2/latex/tradeoff.bib +0 -822
  54. data/ext/phc-winner-argon2/libargon2.pc.in +0 -18
  55. data/ext/phc-winner-argon2/man/argon2.1 +0 -57
  56. data/ext/phc-winner-argon2/src/argon2.c +0 -452
  57. data/ext/phc-winner-argon2/src/bench.c +0 -111
  58. data/ext/phc-winner-argon2/src/blake2/blake2-impl.h +0 -156
  59. data/ext/phc-winner-argon2/src/blake2/blake2.h +0 -89
  60. data/ext/phc-winner-argon2/src/blake2/blake2b.c +0 -390
  61. data/ext/phc-winner-argon2/src/blake2/blamka-round-opt.h +0 -471
  62. data/ext/phc-winner-argon2/src/blake2/blamka-round-ref.h +0 -56
  63. data/ext/phc-winner-argon2/src/core.c +0 -648
  64. data/ext/phc-winner-argon2/src/core.h +0 -228
  65. data/ext/phc-winner-argon2/src/encoding.c +0 -463
  66. data/ext/phc-winner-argon2/src/encoding.h +0 -57
  67. data/ext/phc-winner-argon2/src/genkat.c +0 -213
  68. data/ext/phc-winner-argon2/src/genkat.h +0 -51
  69. data/ext/phc-winner-argon2/src/opt.c +0 -283
  70. data/ext/phc-winner-argon2/src/ref.c +0 -194
  71. data/ext/phc-winner-argon2/src/run.c +0 -337
  72. data/ext/phc-winner-argon2/src/test.c +0 -289
  73. data/ext/phc-winner-argon2/src/thread.c +0 -57
  74. data/ext/phc-winner-argon2/src/thread.h +0 -67
  75. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +0 -231
  76. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +0 -69
  77. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +0 -231
  78. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +0 -69
  79. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +0 -230
  80. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +0 -66
  81. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +0 -244
  82. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +0 -72
  83. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +0 -235
  84. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +0 -69
  85. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +0 -243
  86. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +0 -69
  87. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +0 -231
  88. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +0 -69
  89. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +0 -230
  90. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +0 -66
  91. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +0 -232
  92. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +0 -72
  93. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +0 -231
  94. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +0 -69
@@ -1 +0,0 @@
1
- 680774be1d3ad2e74bbc56ee715dd6eb97a58279bf22edc57d00e840ca1ae469 argon2id_v16
@@ -1,42 +0,0 @@
1
- Set-Variable tempfile -option Constant -value "tempfile"
2
-
3
- function hash($path) {
4
- $fullPath = Resolve-Path $path
5
- $hash = new-object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider
6
-
7
- $contents = [IO.File]::ReadAllText($fullPath) -replace "`r`n?", "`n"
8
- # create UTF-8 encoding without signature
9
- $utf8 = New-Object System.Text.UTF8Encoding $false
10
- # write the text back
11
- [IO.File]::WriteAllText($tempfile, $contents, $utf8)
12
-
13
- $file = [System.IO.File]::Open($tempfile,[System.IO.Filemode]::Open, [System.IO.FileAccess]::Read)
14
- $result = [System.BitConverter]::ToString($hash.ComputeHash($file))
15
- $file.Dispose()
16
-
17
- if (Test-Path $tempfile) {
18
- Remove-Item $tempfile
19
- }
20
-
21
- return $result
22
- }
23
-
24
- function main() {
25
- $files = $(Get-ChildItem * | Where-Object { $_.Name -match '^[a-z2]*(_v)?[0-9]*$' } | select -ExpandProperty name)
26
-
27
- foreach ($file in $files) {
28
- $new = $(hash $file).replace("-","")
29
- $new = $new.ToLower()
30
-
31
- $old=$(Get-Content $file".shasum")
32
- $old = $old.Substring(0, $old.IndexOf(" "))
33
-
34
- if ($new -eq $old) {
35
- Write-Host $file "`tOK"
36
- } else {
37
- Write-Host $file "`tERROR"
38
- }
39
- }
40
- }
41
-
42
- main
@@ -1,13 +0,0 @@
1
- #!/bin/sh
2
-
3
- for file in `ls | grep '^[a-z2]*\(_v\)\?[0-9]*$' | xargs`
4
- do
5
- new=`shasum -a 256 $file`
6
- old=`cat $file.shasum`
7
- if [ "$new" = "$old" ]
8
- then
9
- echo $file "\t" OK
10
- else
11
- echo $file "\t" ERROR
12
- fi
13
- done
@@ -1,50 +0,0 @@
1
- $ErrorActionPreference = "Stop"
2
-
3
- Set-Variable tempfile -option Constant -value "tempfile"
4
-
5
- function CompareFiles($f1, $f2, $i) {
6
- $f1_content = $(Get-Content $f1)
7
- $f2_content = $(Get-Content $f2)
8
-
9
- if (Compare-Object $f1_content $f2_content) {
10
- Write-Host -NoNewline "ERROR"
11
- exit $i
12
- } else {
13
- Write-Host -NoNewline "OK"
14
- }
15
- }
16
-
17
- function main() {
18
- $i = 0
19
- foreach ($opt in @("Ref", "Opt")) {
20
- Write-Output "$opt"
21
-
22
- foreach ($version in @(16, 19)) {
23
- foreach ($type in @("i", "d", "id")) {
24
- $i++
25
-
26
- if ("Ref" -eq $opt) {
27
- vs2015\build\Argon2RefGenKAT.exe $type $version > $tempfile
28
- } else {
29
- vs2015\build\Argon2OptGenKAT.exe $type $version > $tempfile
30
- }
31
-
32
- if (19 -eq $version) {
33
- $kats = "kats\argon2" + $type
34
- } else {
35
- $kats = "kats\argon2" + $type + "_v" + $version
36
- }
37
-
38
- Write-Host -NoNewline "Argon2$type v=$version : "
39
- CompareFiles $tempfile $kats $i
40
- Write-Output ""
41
- }
42
- }
43
- }
44
-
45
- if (Test-Path $tempfile) {
46
- Remove-Item $tempfile
47
- }
48
- }
49
-
50
- main
@@ -1,49 +0,0 @@
1
- #!/bin/sh
2
-
3
- for opttest in "" "OPTTEST=1"
4
- do
5
- if [ "" = "$opttest" ]
6
- then
7
- printf "Default build\n"
8
- else
9
- printf "Force OPTTEST=1\n"
10
- fi
11
-
12
- make genkat $opttest > /dev/null
13
- if [ $? -ne 0 ]
14
- then
15
- exit $?
16
- fi
17
-
18
- i=0
19
- for version in 16 19
20
- do
21
- for type in i d id
22
- do
23
- i=$(($i+1))
24
-
25
- printf "argon2$type v=$version: "
26
-
27
- if [ 19 -eq $version ]
28
- then
29
- kats="kats/argon2"$type
30
- else
31
- kats="kats/argon2"$type"_v"$version
32
- fi
33
-
34
- ./genkat $type $version > tmp
35
- if diff tmp $kats
36
- then
37
- printf "OK"
38
- else
39
- printf "ERROR"
40
- exit $i
41
- fi
42
- printf "\n"
43
- done
44
- done
45
- done
46
-
47
- rm -f tmp
48
-
49
- exit 0