Skip to content

Add HMAC regression tests for Decimal key parsing#2680

Open
alleria173 wants to merge 1 commit into
gchq:masterfrom
alleria173:test/hmac-decimal-key-regression
Open

Add HMAC regression tests for Decimal key parsing#2680
alleria173 wants to merge 1 commit into
gchq:masterfrom
alleria173:test/hmac-decimal-key-regression

Conversation

@alleria173

Copy link
Copy Markdown
Contributor

Description
Adds three HMAC regression tests covering Decimal-format key parsing with the fromDecimal "Auto" delimiter, as requested by a maintainer when closing #2650:

  • HMAC: Decimal key space-delimited matches Latin1 key — verifies a key of "65 65" (Decimal) produces the correct SHA256 digest (the case that was previously broken)
  • HMAC: Latin1 key matches space-delimited Decimal key — the known-good Latin1 baseline ("AA"), producing the same digest
  • HMAC: Decimal key comma-delimited matches Latin1 key — verifies Auto also handles comma-separated input ("65,65")

The underlying bug was fixed by the merge of #2270, so these tests pass against current master; they guard against future regressions of the Auto-delimiter behaviour. No operational code is changed — this PR only adds tests to [Hash.mjs]

Existing Issue
Relates to #2139 and #2217 (both resolved by #2270). Tests originally proposed in #2650 and split out into this stand-alone PR at a maintainer's request.

Screenshots
N/A — no visual changes.

AI disclosure
GitHub Copilot (Claude) was used to isolate these tests from the original PR branch and prepare this submission. The tests have been reviewed and verified manually.

Test Coverage
This PR consists entirely of test coverage. Full non-UI suite passes locally: 2244/2244 operation tests and 262/262 Node API tests.

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 gchq#2139 and gchq#2217.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant