From c57e5e58e197fca322c2840efa435eabb62e4d9d Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 11 Jul 2024 12:27:06 -0500 Subject: fixes to ub:33 hashes now safe --- tests/hash.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/hash.lua') diff --git a/tests/hash.lua b/tests/hash.lua index 28e2323..dce011f 100644 --- a/tests/hash.lua +++ b/tests/hash.lua @@ -54,15 +54,22 @@ function test(name,b,exp,oargs) functions_working = functions_working + 1 llib.io.log(name.." + method working "..hash6.." == "..exp) end - + if(oargs == nil) then hash3 = llib.crypto[name]() else hash3 = llib.crypto[name](table.unpack(oargs)) end b:gsub(".", function(c) hash3:update(c) end) + hash3b = hash3 hash3 = hash3:final() + if hash3 ~= hash3b:final() then + fail = true + functions_failed = functions_failed + 1 + llib.io.error(name.." final not safe") + end + if(oargs == nil) then hash4 = llib.crypto[name.."_init"]() else -- cgit v1.2.3