From 4710c1613aa29ac3d1880217b91b3caabb4af67f Mon Sep 17 00:00:00 2001 From: Ryan Torok Date: Fri, 23 Feb 2024 21:01:27 +0000 Subject: [PATCH] [cryptotest] add build rule to run SPHINCS+ tests Signed-off-by: Ryan Torok --- sw/device/tests/crypto/cryptotest/BUILD | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sw/device/tests/crypto/cryptotest/BUILD b/sw/device/tests/crypto/cryptotest/BUILD index 39b5c3bf39149..0c94183bbb027 100644 --- a/sw/device/tests/crypto/cryptotest/BUILD +++ b/sw/device/tests/crypto/cryptotest/BUILD @@ -365,6 +365,25 @@ cryptotest( test_vectors = KMAC_TESTVECTOR_TARGETS, ) +SPHINCSPLUS_TESTVECTOR_TARGETS = [ + "//sw/host/cryptotest/testvectors/data:{}".format(target) + for target in [ + "rsp_sphincsplus_sha256_128s_simple_json", + ] +] + +SPHINCSPLUS_TESTVECTOR_ARGS = " ".join([ + "--sphincsplus-json=\"$(rootpath {})\"".format(target) + for target in SPHINCSPLUS_TESTVECTOR_TARGETS +]) + +cryptotest( + name = "sphincsplus_kat", + test_args = SPHINCSPLUS_TESTVECTOR_ARGS, + test_harness = "//sw/host/tests/crypto/sphincsplus_kat:harness", + test_vectors = SPHINCSPLUS_TESTVECTOR_TARGETS, +) + # Use the following command to run the entire test suite in a given target: # $ export OT_EXEC_ENV=silicon_owner_sival_rom_ext # $ bazel test --//signing:token=//signing/tokens:cloud_kms \ @@ -392,5 +411,6 @@ test_suite( ":sha512_kat", ":shake128_kat", ":shake256_kat", + ":sphincsplus_kat", ], )