From 234634cfcd95bcf5e9c4896320174ce3f468d90d Mon Sep 17 00:00:00 2001 From: Allan Leary Date: Mon, 20 Jul 2026 09:13:01 +0100 Subject: [PATCH] Add HMAC regression tests for Decimal key parsing Verify that HMAC produces identical digests for equivalent keys supplied as Latin1 ('AA'), space-delimited Decimal ('65 65') and comma-delimited Decimal ('65,65'), covering the fromDecimal Auto delimiter behaviour originally reported in #2139 and #2217. --- tests/operations/tests/Hash.mjs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/operations/tests/Hash.mjs b/tests/operations/tests/Hash.mjs index 1ffb749c05..a805b94fd5 100644 --- a/tests/operations/tests/Hash.mjs +++ b/tests/operations/tests/Hash.mjs @@ -722,6 +722,39 @@ TestRegister.addTests([ } ] }, + { + name: "HMAC: Decimal key space-delimited matches Latin1 key (fromDecimal Auto delimiter regression)", + input: "Hello, World!", + expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957", + recipeConfig: [ + { + "op": "HMAC", + "args": [{"option": "Decimal", "string": "65 65"}, "SHA256"] + } + ] + }, + { + name: "HMAC: Latin1 key matches space-delimited Decimal key (fromDecimal Auto delimiter regression)", + input: "Hello, World!", + expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957", + recipeConfig: [ + { + "op": "HMAC", + "args": [{"option": "Latin1", "string": "AA"}, "SHA256"] + } + ] + }, + { + name: "HMAC: Decimal key comma-delimited matches Latin1 key (fromDecimal Auto delimiter regression)", + input: "Hello, World!", + expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957", + recipeConfig: [ + { + "op": "HMAC", + "args": [{"option": "Decimal", "string": "65,65"}, "SHA256"] + } + ] + }, { name: "MD5: Complex bytes", input: "10dc10e32010de10d010dc10d810d910d010e12e",