sorcery-argon2 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +74 -0
  3. data/.github/workflows/ruby.yml +13 -3
  4. data/.rubocop.yml +112 -2
  5. data/CHANGELOG.md +8 -0
  6. data/MAINTAINING.md +8 -3
  7. data/README.md +155 -14
  8. data/bin/setup +4 -0
  9. data/ext/argon2_wrap/{Makefile → Makefile.real} +1 -0
  10. data/ext/argon2_wrap/extconf.rb +4 -1
  11. data/ext/argon2_wrap/libargon2_wrap.so +0 -0
  12. data/ext/argon2_wrap/tests +0 -0
  13. data/ext/phc-winner-argon2/.git +1 -0
  14. data/ext/phc-winner-argon2/.gitattributes +10 -0
  15. data/ext/phc-winner-argon2/.gitignore +22 -0
  16. data/ext/phc-winner-argon2/.travis.yml +25 -0
  17. data/ext/phc-winner-argon2/Argon2.sln +158 -0
  18. data/ext/phc-winner-argon2/CHANGELOG.md +32 -0
  19. data/ext/phc-winner-argon2/LICENSE +314 -0
  20. data/ext/phc-winner-argon2/Makefile +255 -0
  21. data/ext/phc-winner-argon2/Package.swift +46 -0
  22. data/ext/phc-winner-argon2/README.md +303 -0
  23. data/ext/phc-winner-argon2/appveyor.yml +25 -0
  24. data/ext/phc-winner-argon2/argon2-specs.pdf +0 -0
  25. data/ext/phc-winner-argon2/export.sh +7 -0
  26. data/ext/phc-winner-argon2/include/argon2.h +437 -0
  27. data/ext/phc-winner-argon2/kats/argon2d +12304 -0
  28. data/ext/phc-winner-argon2/kats/argon2d.shasum +1 -0
  29. data/ext/phc-winner-argon2/kats/argon2d_v16 +12304 -0
  30. data/ext/phc-winner-argon2/kats/argon2d_v16.shasum +1 -0
  31. data/ext/phc-winner-argon2/kats/argon2i +12304 -0
  32. data/ext/phc-winner-argon2/kats/argon2i.shasum +1 -0
  33. data/ext/phc-winner-argon2/kats/argon2i_v16 +12304 -0
  34. data/ext/phc-winner-argon2/kats/argon2i_v16.shasum +1 -0
  35. data/ext/phc-winner-argon2/kats/argon2id +12304 -0
  36. data/ext/phc-winner-argon2/kats/argon2id.shasum +1 -0
  37. data/ext/phc-winner-argon2/kats/argon2id_v16 +12304 -0
  38. data/ext/phc-winner-argon2/kats/argon2id_v16.shasum +1 -0
  39. data/ext/phc-winner-argon2/kats/check-sums.ps1 +42 -0
  40. data/ext/phc-winner-argon2/kats/check-sums.sh +13 -0
  41. data/ext/phc-winner-argon2/kats/test.ps1 +50 -0
  42. data/ext/phc-winner-argon2/kats/test.sh +49 -0
  43. data/ext/phc-winner-argon2/latex/IEEEtran.cls +6347 -0
  44. data/ext/phc-winner-argon2/latex/Makefile +18 -0
  45. data/ext/phc-winner-argon2/latex/argon2-specs.tex +920 -0
  46. data/ext/phc-winner-argon2/latex/pics/argon2-par.pdf +0 -0
  47. data/ext/phc-winner-argon2/latex/pics/compression.pdf +0 -0
  48. data/ext/phc-winner-argon2/latex/pics/generic.pdf +0 -0
  49. data/ext/phc-winner-argon2/latex/pics/power-distribution.jpg +0 -0
  50. data/ext/phc-winner-argon2/latex/tradeoff.bib +822 -0
  51. data/ext/phc-winner-argon2/libargon2.pc.in +18 -0
  52. data/ext/phc-winner-argon2/man/argon2.1 +57 -0
  53. data/ext/phc-winner-argon2/src/argon2.c +452 -0
  54. data/ext/phc-winner-argon2/src/bench.c +111 -0
  55. data/ext/phc-winner-argon2/src/blake2/blake2-impl.h +156 -0
  56. data/ext/phc-winner-argon2/src/blake2/blake2.h +89 -0
  57. data/ext/phc-winner-argon2/src/blake2/blake2b.c +390 -0
  58. data/ext/phc-winner-argon2/src/blake2/blamka-round-opt.h +471 -0
  59. data/ext/phc-winner-argon2/src/blake2/blamka-round-ref.h +56 -0
  60. data/ext/phc-winner-argon2/src/core.c +648 -0
  61. data/ext/phc-winner-argon2/src/core.h +228 -0
  62. data/ext/phc-winner-argon2/src/encoding.c +463 -0
  63. data/ext/phc-winner-argon2/src/encoding.h +57 -0
  64. data/ext/phc-winner-argon2/src/genkat.c +213 -0
  65. data/ext/phc-winner-argon2/src/genkat.h +51 -0
  66. data/ext/phc-winner-argon2/src/opt.c +283 -0
  67. data/ext/phc-winner-argon2/src/ref.c +194 -0
  68. data/ext/phc-winner-argon2/src/run.c +337 -0
  69. data/ext/phc-winner-argon2/src/test.c +289 -0
  70. data/ext/phc-winner-argon2/src/thread.c +57 -0
  71. data/ext/phc-winner-argon2/src/thread.h +67 -0
  72. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +231 -0
  73. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +69 -0
  74. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +231 -0
  75. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +69 -0
  76. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +230 -0
  77. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +66 -0
  78. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +244 -0
  79. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +72 -0
  80. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +235 -0
  81. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +69 -0
  82. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +243 -0
  83. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +69 -0
  84. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +231 -0
  85. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +69 -0
  86. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +230 -0
  87. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +66 -0
  88. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +232 -0
  89. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +72 -0
  90. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +231 -0
  91. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +69 -0
  92. data/lib/argon2/ffi_engine.rb +4 -4
  93. data/lib/argon2/password.rb +28 -5
  94. data/lib/argon2/version.rb +1 -1
  95. data/sorcery-argon2.gemspec +3 -2
  96. metadata +91 -8
@@ -0,0 +1 @@
1
+ 680774be1d3ad2e74bbc56ee715dd6eb97a58279bf22edc57d00e840ca1ae469 argon2id_v16
@@ -0,0 +1,42 @@
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
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,50 @@
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
@@ -0,0 +1,49 @@
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