Add kat test Windows support (C backend only)#1698
Conversation
CBMC Results (ML-KEM-768)Full Results (191 proofs)
|
CBMC Results (ML-KEM-512)Full Results (191 proofs)
|
CBMC Results (ML-KEM-1024)Full Results (191 proofs)
|
There was a problem hiding this comment.
I'm not a fan of introducing a second way of running KAT tests.
@hanno-becker, would it be an option to also migrate the other KAT tests to use a Python wrapper?
mkannwischer
left a comment
There was a problem hiding this comment.
@willieyz, I have discussed this with @hanno-becker: We want to keep KAT checking uniform across platforms. I think the Python approach you have picked is likely the most portable. Could you also switch the Makefile to use that script? Please also clean up all unnecessary files that won't be needed anymore then.
Unix KAT tests rely on shell pipelines (sha256sum, cut, xargs) not
available on Windows. Introduce test/src/kat_client.py — a portable
Python script that runs gen_KAT binaries, SHA-256-hashes their stdout,
and checks against META.yml, replacing the shell one-liner:
```
set -o pipefail; $W $MLKEM512_DIR/bin/gen_KAT512 | $SHA256SUM | \
cut -d " " -f 1 | xargs ./META.sh ML-KEM-512 kat-sha256
```
Add gen_KAT{512,768,1024}, gen_KAT, run_kat, and test targets to
Makefile.Microsoft_nmake. quickcheck now aliases test.
To keep KAT checking uniform across platforms, the Unix Makefile is
migrated to the same Python script. A single mechanism now drives
KAT verification on both Unix and Windows. META.sh and the SHA256SUM
detection block are removed as they are no longer needed.
Signed-off-by: willieyz <willie.zhao@chelpis.com>
195958f to
f07387a
Compare
Hello @mkannwischer, thank you for the review and suggestion! |
This PR adds Windows support for the C backend KAT tests.
Currently, Unix KAT tests rely on shell pipelines (sha256sum, cut, xargs) not available on Windows.
Introduce
test/src/kat_client.py, a Python script that runs gen_KAT binaries, SHA-256-hashes their stdout, and checks against META.yml, replacing the shell one-liner for each security level:Also, refactor gen_KAT{512,768,1024}, gen_KAT, run_kat in Makefile.Microsoft_nmake. now quickcheck align with Unix Makefile.