From a4416a226099a24be7a4ffeb45cf3992c637ec81 Mon Sep 17 00:00:00 2001 From: jaguarihno Date: Wed, 31 Jul 2024 14:40:09 +0200 Subject: [PATCH] Add tests --- tests/operations/tests/BLAKE2b.mjs | 18 ++++++++++++++++++ tests/operations/tests/BLAKE2s.mjs | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/operations/tests/BLAKE2b.mjs b/tests/operations/tests/BLAKE2b.mjs index 088b1078..d25ef0b0 100644 --- a/tests/operations/tests/BLAKE2b.mjs +++ b/tests/operations/tests/BLAKE2b.mjs @@ -52,5 +52,23 @@ TestRegister.addTests([ { "op": "BLAKE2b", "args": ["128", "Hex", {string: "pseudorandom key", option: "UTF8"}] } ] + }, + { + name: "BLAKE2b: 224 - Hello World", + input: "Hello World", + expectedOutput: "19790463ef4ad09bdb724e3a6550c640593d4870f6e192ac8147f35d", + recipeConfig: [ + { "op": "BLAKE2b", + "args": ["224", "Hex", {string: "", option: "UTF8"}] } + ] + }, + { + name: "BLAKE2b: 192 - Hello World", + input: "Hello World", + expectedOutput: "317d59b18418b8a12623faf5ebc2072e5e70ac4b8ba6d33a", + recipeConfig: [ + { "op": "BLAKE2b", + "args": ["192", "Hex", {string: "", option: "UTF8"}] } + ] } ]); diff --git a/tests/operations/tests/BLAKE2s.mjs b/tests/operations/tests/BLAKE2s.mjs index fe978d24..7d01a9de 100755 --- a/tests/operations/tests/BLAKE2s.mjs +++ b/tests/operations/tests/BLAKE2s.mjs @@ -43,5 +43,23 @@ TestRegister.addTests([ { "op": "BLAKE2s", "args": ["128", "Hex", {string: "", option: "UTF8"}] } ] + }, + { + name: "BLAKE2s: 224 - Hello World", + input: "Hello World", + expectedOutput: "8a74d9e5c5de9c8a0cb1c292f65808831717e422302f3d58853d58ed", + recipeConfig: [ + { "op": "BLAKE2s", + "args": ["224", "Hex", {string: "", option: "UTF8"}] } + ] + }, + { + name: "BLAKE2s: 192 - Hello World", + input: "Hello World", + expectedOutput: "cc181c0f167a1727308d894c6182bbe6c4865698e7f7bfac", + recipeConfig: [ + { "op": "BLAKE2s", + "args": ["192", "Hex", {string: "", option: "UTF8"}] } + ] } ]);