aboutsummaryrefslogtreecommitdiff
path: root/tests/hash.lua
diff options
context:
space:
mode:
authorame <[email protected]>2024-03-13 16:03:10 -0500
committerame <[email protected]>2024-03-13 16:03:10 -0500
commitcf36c993ba4bb931ecf9c84de41ab0bc5fc915e4 (patch)
tree6e7f5619f468e5b4e34378def3e9f2960d909b38 /tests/hash.lua
parent74289579ac66890ef0d7df2a5ec5f15f8308b8cd (diff)
blake2{b,s} and maybe other stuff
Diffstat (limited to 'tests/hash.lua')
-rw-r--r--tests/hash.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/hash.lua b/tests/hash.lua
index b4e455a..6bd3295 100644
--- a/tests/hash.lua
+++ b/tests/hash.lua
@@ -1,9 +1,16 @@
require "llib"
-function test(name,b,exp)
- local hash = llib.crypto[name](b)
+function test(name,b,exp,oargs)
+ local hash
+ local add = ""
+ if oargs == nil then
+ hash = llib.crypto[name](b)
+ else
+ hash = llib.crypto[name](b,table.unpack(oargs))
+ add = table.concat(oargs, ", ")
+ end
if not (hash == exp) then
- llib.io.error(name.." not working, got \n\t"..hash.." wanted\n\t"..exp)
+ llib.io.error(name.." not working, got \n\t"..hash.." wanted\n\t"..exp.."\n\twith args: {"..add.."}")
else
llib.io.log(name.." was correct, "..hash)
end
@@ -54,3 +61,7 @@ test("metrohash128_v1","meow","bfd8835cbcc06d2be6fc2c8e5ecbcc26")
test("metrohash128_v2","meow","6d8634ccf529269297704cba8bf8707a")
test("murmur1_32","meow","743df82f")
test("murmur2_32","meow","05d01b88")
+test("blake2b","meow","9919ae53fbea6c5da68e51b6e19a890fdbc01baf97fff29efd7efaa7163ea7aa205109b818bde29da815e16b869dbb2cb1b367ed1027f52116287d760808a43d")
+test("blake2b","meow","424969d2fe47cdec2a824709b8066cc1d63cc4b6a16a3c1fa421cc2a6625f7c2",{32})
+test("blake2b","meow","6f30dec70f9ed6d8db2e7407d3e2325af23935464ec3ec1cf4c12575ff3c18043bf772033b91d52978c451d01f7eaeacabda76460b9f4b7bf516dd9d0cc886d",{64,"owo"})
+test("blake2s","meow","f461bed24c982ccb29cb967acdaebc9494b51c1d0f88f6bc47850952261a512d") \ No newline at end of file