Move fipstools/ to util/fipstools/cavp
We have two “fipstools” directories, which is silly. Unify them into one
by moving CAVP stuff into a subdirectory of util/fipstools.
Change-Id: Ibeaa2205c58699f3d042445bfa6a6576a762da6f
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/36624
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb82c6..4ff8663 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -557,8 +557,8 @@
add_subdirectory(crypto)
add_subdirectory(ssl)
add_subdirectory(ssl/test)
-add_subdirectory(fipstools)
add_subdirectory(tool)
+add_subdirectory(util/fipstools/cavp)
add_subdirectory(decrepit)
if(FUZZ)
diff --git a/crypto/fipsmodule/FIPS.md b/crypto/fipsmodule/FIPS.md
index 8e6fa67..69719b6 100644
--- a/crypto/fipsmodule/FIPS.md
+++ b/crypto/fipsmodule/FIPS.md
@@ -13,9 +13,9 @@
## Running CAVP tests
-CAVP results are calculated by `fipstools/cavp`, but that binary is almost always run by `fipstools/run_cavp.go`. The latter knows the set of tests to be processed and the flags needed to configure `cavp` for each one. It must be run from the top of a CAVP directory and needs the following options:
+CAVP results are calculated by `util/fipstools/cavp`, but that binary is almost always run by `util/fipstools/run_cavp.go`. The latter knows the set of tests to be processed and the flags needed to configure `cavp` for each one. It must be run from the top of a CAVP directory and needs the following options:
-1. `-oracle-bin`: points to the location of `fipstools/cavp`
+1. `-oracle-bin`: points to the location of `util/fipstools/cavp`
2. `-no-fax`: this is needed to suppress checking of the FAX files, which are only included in sample sets.
## Breaking power-on and continuous tests
diff --git a/util/fipstools/break-tests.sh b/util/fipstools/break-tests.sh
index 5b1cd21..719461e 100644
--- a/util/fipstools/break-tests.sh
+++ b/util/fipstools/break-tests.sh
@@ -40,7 +40,7 @@
for test in $TESTS; do
pushd build-$test
printf "\n\n\\x1b[1m$test\\x1b[0m\n"
- ./fipstools/test_fips
+ ./util/fipstools/test_fips
echo "Waiting for keypress..."
read
popd
@@ -48,6 +48,6 @@
pushd build-NONE
printf "\\x1b[1mIntegrity\\x1b[0m\n"
-go run ../util/fipstools/break-hash.go ./fipstools/test_fips ./fipstools/test_fips_broken
-./fipstools/test_fips_broken
+go run ../util/fipstools/break-hash.go ./util/fipstools/test_fips ./util/fipstools/test_fips_broken
+./util/fipstools/test_fips_broken
popd
diff --git a/fipstools/CMakeLists.txt b/util/fipstools/cavp/CMakeLists.txt
similarity index 94%
rename from fipstools/CMakeLists.txt
rename to util/fipstools/cavp/CMakeLists.txt
index 58c9a60..a50c9ab 100644
--- a/fipstools/CMakeLists.txt
+++ b/util/fipstools/cavp/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(../include)
+include_directories(../../../include)
if(FIPS)
add_executable(
diff --git a/fipstools/cavp_aes_gcm_test.cc b/util/fipstools/cavp/cavp_aes_gcm_test.cc
similarity index 100%
rename from fipstools/cavp_aes_gcm_test.cc
rename to util/fipstools/cavp/cavp_aes_gcm_test.cc
diff --git a/fipstools/cavp_aes_test.cc b/util/fipstools/cavp/cavp_aes_test.cc
similarity index 100%
rename from fipstools/cavp_aes_test.cc
rename to util/fipstools/cavp/cavp_aes_test.cc
diff --git a/fipstools/cavp_ctr_drbg_test.cc b/util/fipstools/cavp/cavp_ctr_drbg_test.cc
similarity index 100%
rename from fipstools/cavp_ctr_drbg_test.cc
rename to util/fipstools/cavp/cavp_ctr_drbg_test.cc
diff --git a/fipstools/cavp_ecdsa2_keypair_test.cc b/util/fipstools/cavp/cavp_ecdsa2_keypair_test.cc
similarity index 100%
rename from fipstools/cavp_ecdsa2_keypair_test.cc
rename to util/fipstools/cavp/cavp_ecdsa2_keypair_test.cc
diff --git a/fipstools/cavp_ecdsa2_pkv_test.cc b/util/fipstools/cavp/cavp_ecdsa2_pkv_test.cc
similarity index 100%
rename from fipstools/cavp_ecdsa2_pkv_test.cc
rename to util/fipstools/cavp/cavp_ecdsa2_pkv_test.cc
diff --git a/fipstools/cavp_ecdsa2_siggen_test.cc b/util/fipstools/cavp/cavp_ecdsa2_siggen_test.cc
similarity index 100%
rename from fipstools/cavp_ecdsa2_siggen_test.cc
rename to util/fipstools/cavp/cavp_ecdsa2_siggen_test.cc
diff --git a/fipstools/cavp_ecdsa2_sigver_test.cc b/util/fipstools/cavp/cavp_ecdsa2_sigver_test.cc
similarity index 100%
rename from fipstools/cavp_ecdsa2_sigver_test.cc
rename to util/fipstools/cavp/cavp_ecdsa2_sigver_test.cc
diff --git a/fipstools/cavp_hmac_test.cc b/util/fipstools/cavp/cavp_hmac_test.cc
similarity index 100%
rename from fipstools/cavp_hmac_test.cc
rename to util/fipstools/cavp/cavp_hmac_test.cc
diff --git a/fipstools/cavp_kas_test.cc b/util/fipstools/cavp/cavp_kas_test.cc
similarity index 100%
rename from fipstools/cavp_kas_test.cc
rename to util/fipstools/cavp/cavp_kas_test.cc
diff --git a/fipstools/cavp_keywrap_test.cc b/util/fipstools/cavp/cavp_keywrap_test.cc
similarity index 100%
rename from fipstools/cavp_keywrap_test.cc
rename to util/fipstools/cavp/cavp_keywrap_test.cc
diff --git a/fipstools/cavp_main.cc b/util/fipstools/cavp/cavp_main.cc
similarity index 100%
rename from fipstools/cavp_main.cc
rename to util/fipstools/cavp/cavp_main.cc
diff --git a/fipstools/cavp_rsa2_keygen_test.cc b/util/fipstools/cavp/cavp_rsa2_keygen_test.cc
similarity index 100%
rename from fipstools/cavp_rsa2_keygen_test.cc
rename to util/fipstools/cavp/cavp_rsa2_keygen_test.cc
diff --git a/fipstools/cavp_rsa2_siggen_test.cc b/util/fipstools/cavp/cavp_rsa2_siggen_test.cc
similarity index 100%
rename from fipstools/cavp_rsa2_siggen_test.cc
rename to util/fipstools/cavp/cavp_rsa2_siggen_test.cc
diff --git a/fipstools/cavp_rsa2_sigver_test.cc b/util/fipstools/cavp/cavp_rsa2_sigver_test.cc
similarity index 100%
rename from fipstools/cavp_rsa2_sigver_test.cc
rename to util/fipstools/cavp/cavp_rsa2_sigver_test.cc
diff --git a/fipstools/cavp_sha_monte_test.cc b/util/fipstools/cavp/cavp_sha_monte_test.cc
similarity index 100%
rename from fipstools/cavp_sha_monte_test.cc
rename to util/fipstools/cavp/cavp_sha_monte_test.cc
diff --git a/fipstools/cavp_sha_test.cc b/util/fipstools/cavp/cavp_sha_test.cc
similarity index 100%
rename from fipstools/cavp_sha_test.cc
rename to util/fipstools/cavp/cavp_sha_test.cc
diff --git a/fipstools/cavp_tdes_test.cc b/util/fipstools/cavp/cavp_tdes_test.cc
similarity index 100%
rename from fipstools/cavp_tdes_test.cc
rename to util/fipstools/cavp/cavp_tdes_test.cc
diff --git a/fipstools/cavp_test_util.cc b/util/fipstools/cavp/cavp_test_util.cc
similarity index 100%
rename from fipstools/cavp_test_util.cc
rename to util/fipstools/cavp/cavp_test_util.cc
diff --git a/fipstools/cavp_test_util.h b/util/fipstools/cavp/cavp_test_util.h
similarity index 100%
rename from fipstools/cavp_test_util.h
rename to util/fipstools/cavp/cavp_test_util.h
diff --git a/fipstools/cavp_tlskdf_test.cc b/util/fipstools/cavp/cavp_tlskdf_test.cc
similarity index 100%
rename from fipstools/cavp_tlskdf_test.cc
rename to util/fipstools/cavp/cavp_tlskdf_test.cc
diff --git a/fipstools/run_cavp.go b/util/fipstools/cavp/run_cavp.go
similarity index 100%
rename from fipstools/run_cavp.go
rename to util/fipstools/cavp/run_cavp.go
diff --git a/fipstools/test_fips.c b/util/fipstools/cavp/test_fips.c
similarity index 100%
rename from fipstools/test_fips.c
rename to util/fipstools/cavp/test_fips.c