This directory contains tests for the ACVP infrastructure itself. These tests consist of test vector files and their expected outputs. The test vectors are stored as bzip2 compressed JSON in the vector/ directory, and the corresponding expected output is the file with the same name in the expected/ directory.
tests.json contains a list of all the tests: their input and output files, and the module wrapper to use with them. Some tests use the standard BoringSSL module wrapper, which we use for ACVP validations, called modulewrapper. But some tests use algorithms that we don‘t support in BoringSSL and, for those, there’s a special test-only module wrapper written in Go called testmodulewrapper.
When adding support for a new algorithm, the process for adding tests is:
acvptool/.)test/trim_vectors.go can be used to keep only a (hopefully valid) subset of them.test/vectors/, named after the algorithm and without any json suffix.bzip2 -9 test/vectors/ALGO. This will produce the .bz2 file. Delete the original../acvptool -json /tmp/trimmed_vectors.json > test/expected/ALGO in the parent directory to generate the expected results. (If you need to use the test-only module wrapper then use the -wrapper argument.)bzip2 -9 test/expected/ALGO and delete the original.test/tests.json to include the new test.ninja -C build run_tests in the top-level directory to ensure that everything is working.