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.
- checksums.yaml +4 -4
- data/.github/workflows/codeql.yml +74 -0
- data/.github/workflows/ruby.yml +13 -3
- data/.rubocop.yml +112 -2
- data/CHANGELOG.md +8 -0
- data/MAINTAINING.md +8 -3
- data/README.md +155 -14
- data/bin/setup +4 -0
- data/ext/argon2_wrap/{Makefile → Makefile.real} +1 -0
- data/ext/argon2_wrap/extconf.rb +4 -1
- data/ext/argon2_wrap/libargon2_wrap.so +0 -0
- data/ext/argon2_wrap/tests +0 -0
- data/ext/phc-winner-argon2/.git +1 -0
- data/ext/phc-winner-argon2/.gitattributes +10 -0
- data/ext/phc-winner-argon2/.gitignore +22 -0
- data/ext/phc-winner-argon2/.travis.yml +25 -0
- data/ext/phc-winner-argon2/Argon2.sln +158 -0
- data/ext/phc-winner-argon2/CHANGELOG.md +32 -0
- data/ext/phc-winner-argon2/LICENSE +314 -0
- data/ext/phc-winner-argon2/Makefile +255 -0
- data/ext/phc-winner-argon2/Package.swift +46 -0
- data/ext/phc-winner-argon2/README.md +303 -0
- data/ext/phc-winner-argon2/appveyor.yml +25 -0
- data/ext/phc-winner-argon2/argon2-specs.pdf +0 -0
- data/ext/phc-winner-argon2/export.sh +7 -0
- data/ext/phc-winner-argon2/include/argon2.h +437 -0
- data/ext/phc-winner-argon2/kats/argon2d +12304 -0
- data/ext/phc-winner-argon2/kats/argon2d.shasum +1 -0
- data/ext/phc-winner-argon2/kats/argon2d_v16 +12304 -0
- data/ext/phc-winner-argon2/kats/argon2d_v16.shasum +1 -0
- data/ext/phc-winner-argon2/kats/argon2i +12304 -0
- data/ext/phc-winner-argon2/kats/argon2i.shasum +1 -0
- data/ext/phc-winner-argon2/kats/argon2i_v16 +12304 -0
- data/ext/phc-winner-argon2/kats/argon2i_v16.shasum +1 -0
- data/ext/phc-winner-argon2/kats/argon2id +12304 -0
- data/ext/phc-winner-argon2/kats/argon2id.shasum +1 -0
- data/ext/phc-winner-argon2/kats/argon2id_v16 +12304 -0
- data/ext/phc-winner-argon2/kats/argon2id_v16.shasum +1 -0
- data/ext/phc-winner-argon2/kats/check-sums.ps1 +42 -0
- data/ext/phc-winner-argon2/kats/check-sums.sh +13 -0
- data/ext/phc-winner-argon2/kats/test.ps1 +50 -0
- data/ext/phc-winner-argon2/kats/test.sh +49 -0
- data/ext/phc-winner-argon2/latex/IEEEtran.cls +6347 -0
- data/ext/phc-winner-argon2/latex/Makefile +18 -0
- data/ext/phc-winner-argon2/latex/argon2-specs.tex +920 -0
- data/ext/phc-winner-argon2/latex/pics/argon2-par.pdf +0 -0
- data/ext/phc-winner-argon2/latex/pics/compression.pdf +0 -0
- data/ext/phc-winner-argon2/latex/pics/generic.pdf +0 -0
- data/ext/phc-winner-argon2/latex/pics/power-distribution.jpg +0 -0
- data/ext/phc-winner-argon2/latex/tradeoff.bib +822 -0
- data/ext/phc-winner-argon2/libargon2.pc.in +18 -0
- data/ext/phc-winner-argon2/man/argon2.1 +57 -0
- data/ext/phc-winner-argon2/src/argon2.c +452 -0
- data/ext/phc-winner-argon2/src/bench.c +111 -0
- data/ext/phc-winner-argon2/src/blake2/blake2-impl.h +156 -0
- data/ext/phc-winner-argon2/src/blake2/blake2.h +89 -0
- data/ext/phc-winner-argon2/src/blake2/blake2b.c +390 -0
- data/ext/phc-winner-argon2/src/blake2/blamka-round-opt.h +471 -0
- data/ext/phc-winner-argon2/src/blake2/blamka-round-ref.h +56 -0
- data/ext/phc-winner-argon2/src/core.c +648 -0
- data/ext/phc-winner-argon2/src/core.h +228 -0
- data/ext/phc-winner-argon2/src/encoding.c +463 -0
- data/ext/phc-winner-argon2/src/encoding.h +57 -0
- data/ext/phc-winner-argon2/src/genkat.c +213 -0
- data/ext/phc-winner-argon2/src/genkat.h +51 -0
- data/ext/phc-winner-argon2/src/opt.c +283 -0
- data/ext/phc-winner-argon2/src/ref.c +194 -0
- data/ext/phc-winner-argon2/src/run.c +337 -0
- data/ext/phc-winner-argon2/src/test.c +289 -0
- data/ext/phc-winner-argon2/src/thread.c +57 -0
- data/ext/phc-winner-argon2/src/thread.h +67 -0
- data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +231 -0
- data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +69 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +231 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +69 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +230 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +66 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +244 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +72 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +235 -0
- data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +69 -0
- data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +243 -0
- data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +69 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +231 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +69 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +230 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +66 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +232 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +72 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +231 -0
- data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +69 -0
- data/lib/argon2/ffi_engine.rb +4 -4
- data/lib/argon2/password.rb +28 -5
- data/lib/argon2/version.rb +1 -1
- data/sorcery-argon2.gemspec +3 -2
- 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,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
|