aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_hashes_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-12-12 07:10:54 +0100
committerKim Alvefur <zash@zash.se>2022-12-12 07:10:54 +0100
commit080d7974bf0c1da8a1c0578d67c3172facc9d719 (patch)
tree838d6904e47ab8681928b37701ff4f1c6e89184a /spec/util_hashes_spec.lua
parentbaff85a52c5fda705e8b3699410c770f015d89ab (diff)
parentc916ce76ee89dca32e7e653dff1ade4732462efc (diff)
downloadprosody-080d7974bf0c1da8a1c0578d67c3172facc9d719.tar.gz
prosody-080d7974bf0c1da8a1c0578d67c3172facc9d719.zip
Merge 0.12->trunk
Diffstat (limited to 'spec/util_hashes_spec.lua')
-rw-r--r--spec/util_hashes_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/util_hashes_spec.lua b/spec/util_hashes_spec.lua
index 51a4a79c..b3b81467 100644
--- a/spec/util_hashes_spec.lua
+++ b/spec/util_hashes_spec.lua
@@ -53,3 +53,18 @@ describe("PBKDF2-HMAC-SHA256", function ()
end);
+describe("SHA-3", function ()
+ describe("256", function ()
+ it("works", function ()
+ local expected = "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"
+ assert.equal(expected, hashes.sha3_256("", true));
+ end);
+ end);
+ describe("512", function ()
+ it("works", function ()
+ local expected = "a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26"
+ assert.equal(expected, hashes.sha3_512("", true));
+ end);
+ end);
+end);
+