Add script for automating sync. and regeneration of ACVP kats for ml-kem keygen algo

Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
This commit is contained in:
Anjan Roy
2025-09-20 21:20:09 +05:30
parent 3efc5731c2
commit f190c37719
2 changed files with 23 additions and 0 deletions

View File

@@ -47,3 +47,7 @@ clean: ## Remove build directory
.PHONY: format
format: $(ML_KEM_SOURCES) $(TEST_SOURCES) $(TEST_HEADERS) $(BENCHMARK_SOURCES) $(BENCHMARK_HEADERS) ## Format source code
clang-format -i $^
.PHONY: sync_acvp_kats
sync_acvp_kats: ## Downloads NIST ACVP KAT vectors and updates local KATs
cd kats/scripts && ./sync_acvp_kats.sh && cd -

19
kats/scripts/sync_acvp_kats.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
ACVP_SERVER_REPO_PATH="ACVP-Server"
if [ -d "$ACVP_SERVER_REPO_PATH" ]; then
echo "> $ACVP_SERVER_REPO_PATH repository exists, let's just fetch latest."
pushd $ACVP_SERVER_REPO_PATH
git checkout master
git fetch
git pull origin master
popd
else
echo "> $ACVP_SERVER_REPO_PATH repository doesn't exist, let's clone it."
git clone https://github.com/usnistgov/ACVP-Server.git
fi
cat ./ACVP-Server/gen-val/json-files/ML-KEM-keyGen-FIPS203/internalProjection.json | python parse_ml_kem_keygen_acvp_kat.py
echo "> Generated all NIST ACVP KATs."