Fix Keccak unit tests and add pure Keccak known-answer tests#98
Open
omonien wants to merge 1 commit into
Open
Conversation
Remove broken Keccak-224 hand vectors and the early exit in SetUp; drive SHA3 CAVP examples through domain fixup via AddLastByteForCodeTest. Recompute MDuni after domain rewrite for Keccak fixtures so Unicode CalcString matches fixed-up input. Add pure Keccak empty/abc known-answer tests (PyCryptodome) to cover non-SHA3 domain separation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For Markus — theme: red-test cleanup (Cluster A, tests only)
No production hash implementation is changed. This PR only fixes incorrect / incomplete unit tests for Keccak vs SHA-3.
Problem
Several Keccak cases failed for the wrong reasons:
MDuni) were trusted even after the test harness rewrites input for Keccak domain separation (SHA-3 padding vs pure Keccak). After rewrite, the file’s Unicode expected digest no longer matches.abc) as opposed to SHA-3.Fix
AddLastByteForCodeTest)abcKATs (PyCryptodome / XKCP-style) for 224/256/384/512Scope boundary
Unit Tests/Tests/TestDECHashSHA3.pasonlySource/DECHash.paslarge-buffer Absorb (#94) — separate PRRisk
Low (tests only). If a pure Keccak KAT disagreed with your intended DEC domain rules, that would surface here — vectors are chosen to match widely used pure-Keccak digests.
Independence
Can merge independently of DUnitX and GCM. Works with classic DUnit as well (same shared test unit).
Test plan