mirror of
https://git.sr.ht/~sircmpwn/mkproof
synced 2024-12-03 23:18:13 +01:00
87d922c6c6
git-subtree-dir: argon2i git-subtree-mainline: 3e7a084af1a451c4d92dc09d3dfccec3b8c2fb4e git-subtree-split: 440ceb9612d5a20997e3e12728542df2de713ca4
51 lines
1.2 KiB
PowerShell
51 lines
1.2 KiB
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
Set-Variable tempfile -option Constant -value "tempfile"
|
|
|
|
function CompareFiles($f1, $f2, $i) {
|
|
$f1_content = $(Get-Content $f1)
|
|
$f2_content = $(Get-Content $f2)
|
|
|
|
if (Compare-Object $f1_content $f2_content) {
|
|
Write-Host -NoNewline "ERROR"
|
|
exit $i
|
|
} else {
|
|
Write-Host -NoNewline "OK"
|
|
}
|
|
}
|
|
|
|
function main() {
|
|
$i = 0
|
|
foreach ($opt in @("Ref", "Opt")) {
|
|
Write-Output "$opt"
|
|
|
|
foreach ($version in @(16, 19)) {
|
|
foreach ($type in @("i", "d", "id")) {
|
|
$i++
|
|
|
|
if ("Ref" -eq $opt) {
|
|
vs2015\build\Argon2RefGenKAT.exe $type $version > $tempfile
|
|
} else {
|
|
vs2015\build\Argon2OptGenKAT.exe $type $version > $tempfile
|
|
}
|
|
|
|
if (19 -eq $version) {
|
|
$kats = "kats\argon2" + $type
|
|
} else {
|
|
$kats = "kats\argon2" + $type + "_v" + $version
|
|
}
|
|
|
|
Write-Host -NoNewline "Argon2$type v=$version : "
|
|
CompareFiles $tempfile $kats $i
|
|
Write-Output ""
|
|
}
|
|
}
|
|
}
|
|
|
|
if (Test-Path $tempfile) {
|
|
Remove-Item $tempfile
|
|
}
|
|
}
|
|
|
|
main
|