Revert "Also extract the test data files from bcm"

This reverts commit 5326e94dd188beba0a5e536b1d2723aee65bd85d.

Change-Id: Ieb7fafaf9ca553330620f3f5c30fb69d54bdb8aa
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68808
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: Bob Beck <bbe@google.com>
diff --git a/build.json b/build.json
index 6bd2216..c6d3bf6 100644
--- a/build.json
+++ b/build.json
@@ -857,26 +857,26 @@
         ],
         "data": [
             "crypto/blake2/blake2b256_tests.txt",
-            "crypto/cipher_extra/aes_tests.txt",
-            "crypto/cipher_extra/cavp_3des_cmac_tests.txt",
-            "crypto/cipher_extra/cavp_aes128_cmac_tests.txt",
-            "crypto/cipher_extra/cavp_aes192_cmac_tests.txt",
-            "crypto/cipher_extra/cavp_aes256_cmac_tests.txt",
             "crypto/cipher_extra/test/*.txt",
             "crypto/cipher_extra/test/nist_cavp/*.txt",
             "crypto/curve25519/ed25519_tests.txt",
             "crypto/dilithium/dilithium_tests.txt",
             "crypto/dilithium/edge_cases_draft_dilithium3_sign.txt",
             "crypto/dilithium/edge_cases_draft_dilithium3_verify.txt",
-            "crypto/ec_extra/ec_scalar_base_mult_tests.txt",
             "crypto/ec_extra/p256-nistz_tests.txt",
-            "crypto/ecdsa_extra/ecdsa_sign_tests.txt",
-            "crypto/ecdsa_extra/ecdsa_verify_tests.txt",
             "crypto/ecdh_extra/ecdh_tests.txt",
             "crypto/evp/evp_tests.txt",
             "crypto/evp/scrypt_tests.txt",
-            "crypto/bn_extra/test/*.txt",
-            "crypto/cipher_extra/gcm_tests.txt",
+            "crypto/fipsmodule/aes/aes_tests.txt",
+            "crypto/fipsmodule/bn/test/*.txt",
+            "crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt",
+            "crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt",
+            "crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt",
+            "crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt",
+            "crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt",
+            "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
+            "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
+            "crypto/fipsmodule/modes/gcm_tests.txt",
             "crypto/hmac_extra/hmac_tests.txt",
             "crypto/hpke/hpke_test_vectors.txt",
             "crypto/keccak/keccak_tests.txt",
diff --git a/crypto/bn_extra/bn_test.cc b/crypto/bn_extra/bn_test.cc
index 963b717..47af50d 100644
--- a/crypto/bn_extra/bn_test.cc
+++ b/crypto/bn_extra/bn_test.cc
@@ -1039,52 +1039,52 @@
 }
 
 TEST_F(BNTest, ExpTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/exp_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/exp_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, GCDTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/gcd_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/gcd_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ModExpTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/mod_exp_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/mod_exp_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ModInvTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/mod_inv_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/mod_inv_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ModMulTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/mod_mul_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/mod_mul_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ModSqrtTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/mod_sqrt_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/mod_sqrt_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ProductTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/product_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/product_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, QuotientTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/quotient_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/quotient_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, ShiftTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/shift_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/shift_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
 TEST_F(BNTest, SumTestVectors) {
-  FileTestGTest("crypto/bn_extra/test/sum_tests.txt",
+  FileTestGTest("crypto/fipsmodule/bn/test/sum_tests.txt",
                 [&](FileTest *t) { RunBNFileTest(t, ctx()); });
 }
 
@@ -2380,7 +2380,7 @@
 
 TEST_F(BNTest, MillerRabinIteration) {
   FileTestGTest(
-      "crypto/bn_extra/test/miller_rabin_tests.txt", [&](FileTest *t) {
+      "crypto/fipsmodule/bn/test/miller_rabin_tests.txt", [&](FileTest *t) {
         BIGNUMFileTest bn_test(t, /*large_mask=*/0);
 
         bssl::UniquePtr<BIGNUM> w = bn_test.GetBIGNUM("W");
diff --git a/crypto/cipher_extra/aes_test.cc b/crypto/cipher_extra/aes_test.cc
index 917d97b..47e5666 100644
--- a/crypto/cipher_extra/aes_test.cc
+++ b/crypto/cipher_extra/aes_test.cc
@@ -150,7 +150,7 @@
 }
 
 TEST(AESTest, TestVectors) {
-  FileTestGTest("crypto/cipher_extra/aes_tests.txt", [](FileTest *t) {
+  FileTestGTest("crypto/fipsmodule/aes/aes_tests.txt", [](FileTest *t) {
     if (t->GetParameter() == "Raw") {
       TestRaw(t);
     } else if (t->GetParameter() == "KeyWrap") {
diff --git a/crypto/cipher_extra/cmac_test.cc b/crypto/cipher_extra/cmac_test.cc
index 0c8f83f..f6da0eb 100644
--- a/crypto/cipher_extra/cmac_test.cc
+++ b/crypto/cipher_extra/cmac_test.cc
@@ -248,21 +248,21 @@
 }
 
 TEST(CMACTest, CAVPAES128) {
-  RunCAVPTest("crypto/cipher_extra/cavp_aes128_cmac_tests.txt",
+  RunCAVPTest("crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt",
               EVP_aes_128_cbc(), false);
 }
 
 TEST(CMACTest, CAVPAES192) {
-  RunCAVPTest("crypto/cipher_extra/cavp_aes192_cmac_tests.txt",
+  RunCAVPTest("crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt",
               EVP_aes_192_cbc(), false);
 }
 
 TEST(CMACTest, CAVPAES256) {
-  RunCAVPTest("crypto/cipher_extra/cavp_aes256_cmac_tests.txt",
+  RunCAVPTest("crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt",
               EVP_aes_256_cbc(), false);
 }
 
 TEST(CMACTest, CAVP3DES) {
-  RunCAVPTest("crypto/cipher_extra/cavp_3des_cmac_tests.txt",
+  RunCAVPTest("crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt",
               EVP_des_ede3_cbc(), true);
 }
diff --git a/crypto/cipher_extra/gcm_test.cc b/crypto/cipher_extra/gcm_test.cc
index f4123ae..456ce99 100644
--- a/crypto/cipher_extra/gcm_test.cc
+++ b/crypto/cipher_extra/gcm_test.cc
@@ -63,7 +63,7 @@
 
 
 TEST(GCMTest, TestVectors) {
-  FileTestGTest("crypto/cipher_extra/gcm_tests.txt", [](FileTest *t) {
+  FileTestGTest("crypto/fipsmodule/modes/gcm_tests.txt", [](FileTest *t) {
     std::vector<uint8_t> key, plaintext, additional_data, nonce, ciphertext,
         tag;
     ASSERT_TRUE(t->GetBytes(&key, "Key"));
diff --git a/crypto/ec_extra/ec_test.cc b/crypto/ec_extra/ec_test.cc
index fbe4d76..a9e8ffe 100644
--- a/crypto/ec_extra/ec_test.cc
+++ b/crypto/ec_extra/ec_test.cc
@@ -1024,7 +1024,7 @@
   bssl::UniquePtr<BN_CTX> ctx(BN_CTX_new());
   ASSERT_TRUE(ctx);
 
-  FileTestGTest("crypto/ec_extra/ec_scalar_base_mult_tests.txt",
+  FileTestGTest("crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt",
                 [&](FileTest *t) {
     const EC_GROUP *group = GetCurve(t, "Curve");
     ASSERT_TRUE(group);
@@ -1070,7 +1070,7 @@
   bssl::UniquePtr<BN_CTX> ctx(BN_CTX_new());
   ASSERT_TRUE(ctx);
 
-  FileTestGTest("crypto/ec_extra/ec_scalar_base_mult_tests.txt",
+  FileTestGTest("crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt",
                 [&](FileTest *t) {
     const EC_GROUP *group = GetCurve(t, "Curve");
     ASSERT_TRUE(group);
diff --git a/crypto/ecdsa_extra/ecdsa_test.cc b/crypto/ecdsa_extra/ecdsa_test.cc
index 969424c..53d7bc2 100644
--- a/crypto/ecdsa_extra/ecdsa_test.cc
+++ b/crypto/ecdsa_extra/ecdsa_test.cc
@@ -64,6 +64,7 @@
 #include <openssl/nid.h>
 #include <openssl/rand.h>
 
+//#include "../ec/internal.h"
 #include "../test/file_test.h"
 #include "../test/test_util.h"
 
@@ -375,7 +376,7 @@
 }
 
 TEST(ECDSATest, VerifyTestVectors) {
-  FileTestGTest("crypto/ecdsa_extra/ecdsa_verify_tests.txt",
+  FileTestGTest("crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
                 [](FileTest *t) {
     for (bool custom_group : {false, true}) {
       SCOPED_TRACE(custom_group);
@@ -417,7 +418,7 @@
 }
 
 TEST(ECDSATest, SignTestVectors) {
-  FileTestGTest("crypto/ecdsa_extra/ecdsa_sign_tests.txt",
+  FileTestGTest("crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
                 [](FileTest *t) {
     for (bool custom_group : {false, true}) {
       SCOPED_TRACE(custom_group);
diff --git a/crypto/cipher_extra/aes_tests.txt b/crypto/fipsmodule/aes/aes_tests.txt
similarity index 100%
rename from crypto/cipher_extra/aes_tests.txt
rename to crypto/fipsmodule/aes/aes_tests.txt
diff --git a/crypto/bn_extra/bn_test_to_fuzzer.go b/crypto/fipsmodule/bn/bn_test_to_fuzzer.go
similarity index 100%
rename from crypto/bn_extra/bn_test_to_fuzzer.go
rename to crypto/fipsmodule/bn/bn_test_to_fuzzer.go
diff --git a/crypto/bn_extra/check_bn_tests.go b/crypto/fipsmodule/bn/check_bn_tests.go
similarity index 100%
rename from crypto/bn_extra/check_bn_tests.go
rename to crypto/fipsmodule/bn/check_bn_tests.go
diff --git a/crypto/bn_extra/test/exp_tests.txt b/crypto/fipsmodule/bn/test/exp_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/exp_tests.txt
rename to crypto/fipsmodule/bn/test/exp_tests.txt
diff --git a/crypto/bn_extra/test/gcd_tests.txt b/crypto/fipsmodule/bn/test/gcd_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/gcd_tests.txt
rename to crypto/fipsmodule/bn/test/gcd_tests.txt
diff --git a/crypto/bn_extra/test/miller_rabin_tests.txt b/crypto/fipsmodule/bn/test/miller_rabin_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/miller_rabin_tests.txt
rename to crypto/fipsmodule/bn/test/miller_rabin_tests.txt
diff --git a/crypto/bn_extra/test/mod_exp_tests.txt b/crypto/fipsmodule/bn/test/mod_exp_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/mod_exp_tests.txt
rename to crypto/fipsmodule/bn/test/mod_exp_tests.txt
diff --git a/crypto/bn_extra/test/mod_inv_tests.txt b/crypto/fipsmodule/bn/test/mod_inv_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/mod_inv_tests.txt
rename to crypto/fipsmodule/bn/test/mod_inv_tests.txt
diff --git a/crypto/bn_extra/test/mod_mul_tests.txt b/crypto/fipsmodule/bn/test/mod_mul_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/mod_mul_tests.txt
rename to crypto/fipsmodule/bn/test/mod_mul_tests.txt
diff --git a/crypto/bn_extra/test/mod_sqrt_tests.txt b/crypto/fipsmodule/bn/test/mod_sqrt_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/mod_sqrt_tests.txt
rename to crypto/fipsmodule/bn/test/mod_sqrt_tests.txt
diff --git a/crypto/bn_extra/test/product_tests.txt b/crypto/fipsmodule/bn/test/product_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/product_tests.txt
rename to crypto/fipsmodule/bn/test/product_tests.txt
diff --git a/crypto/bn_extra/test/quotient_tests.txt b/crypto/fipsmodule/bn/test/quotient_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/quotient_tests.txt
rename to crypto/fipsmodule/bn/test/quotient_tests.txt
diff --git a/crypto/bn_extra/test/shift_tests.txt b/crypto/fipsmodule/bn/test/shift_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/shift_tests.txt
rename to crypto/fipsmodule/bn/test/shift_tests.txt
diff --git a/crypto/bn_extra/test/sum_tests.txt b/crypto/fipsmodule/bn/test/sum_tests.txt
similarity index 100%
rename from crypto/bn_extra/test/sum_tests.txt
rename to crypto/fipsmodule/bn/test/sum_tests.txt
diff --git a/crypto/cipher_extra/cavp_3des_cmac_tests.txt b/crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt
similarity index 100%
rename from crypto/cipher_extra/cavp_3des_cmac_tests.txt
rename to crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt
diff --git a/crypto/cipher_extra/cavp_aes128_cmac_tests.txt b/crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt
similarity index 100%
rename from crypto/cipher_extra/cavp_aes128_cmac_tests.txt
rename to crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt
diff --git a/crypto/cipher_extra/cavp_aes192_cmac_tests.txt b/crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt
similarity index 100%
rename from crypto/cipher_extra/cavp_aes192_cmac_tests.txt
rename to crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt
diff --git a/crypto/cipher_extra/cavp_aes256_cmac_tests.txt b/crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt
similarity index 100%
rename from crypto/cipher_extra/cavp_aes256_cmac_tests.txt
rename to crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt
diff --git a/crypto/ec_extra/ec_scalar_base_mult_tests.txt b/crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt
similarity index 100%
rename from crypto/ec_extra/ec_scalar_base_mult_tests.txt
rename to crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt
diff --git a/crypto/ec_extra/make_ec_scalar_base_mult_tests.go b/crypto/fipsmodule/ec/make_ec_scalar_base_mult_tests.go
similarity index 100%
rename from crypto/ec_extra/make_ec_scalar_base_mult_tests.go
rename to crypto/fipsmodule/ec/make_ec_scalar_base_mult_tests.go
diff --git a/crypto/ec_extra/make_p256-nistz-tests.go b/crypto/fipsmodule/ec/make_p256-nistz-tests.go
similarity index 100%
rename from crypto/ec_extra/make_p256-nistz-tests.go
rename to crypto/fipsmodule/ec/make_p256-nistz-tests.go
diff --git a/crypto/ecdsa_extra/ecdsa_sign_tests.txt b/crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt
similarity index 100%
rename from crypto/ecdsa_extra/ecdsa_sign_tests.txt
rename to crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt
diff --git a/crypto/ecdsa_extra/ecdsa_verify_tests.txt b/crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt
similarity index 100%
rename from crypto/ecdsa_extra/ecdsa_verify_tests.txt
rename to crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt
diff --git a/crypto/cipher_extra/gcm_tests.txt b/crypto/fipsmodule/modes/gcm_tests.txt
similarity index 100%
rename from crypto/cipher_extra/gcm_tests.txt
rename to crypto/fipsmodule/modes/gcm_tests.txt
diff --git a/gen/sources.bzl b/gen/sources.bzl
index cc8500e..f0896a0 100644
--- a/gen/sources.bzl
+++ b/gen/sources.bzl
@@ -752,23 +752,6 @@
 
 crypto_test_data = [
   "crypto/blake2/blake2b256_tests.txt",
-  "crypto/bn_extra/test/exp_tests.txt",
-  "crypto/bn_extra/test/gcd_tests.txt",
-  "crypto/bn_extra/test/miller_rabin_tests.txt",
-  "crypto/bn_extra/test/mod_exp_tests.txt",
-  "crypto/bn_extra/test/mod_inv_tests.txt",
-  "crypto/bn_extra/test/mod_mul_tests.txt",
-  "crypto/bn_extra/test/mod_sqrt_tests.txt",
-  "crypto/bn_extra/test/product_tests.txt",
-  "crypto/bn_extra/test/quotient_tests.txt",
-  "crypto/bn_extra/test/shift_tests.txt",
-  "crypto/bn_extra/test/sum_tests.txt",
-  "crypto/cipher_extra/aes_tests.txt",
-  "crypto/cipher_extra/cavp_3des_cmac_tests.txt",
-  "crypto/cipher_extra/cavp_aes128_cmac_tests.txt",
-  "crypto/cipher_extra/cavp_aes192_cmac_tests.txt",
-  "crypto/cipher_extra/cavp_aes256_cmac_tests.txt",
-  "crypto/cipher_extra/gcm_tests.txt",
   "crypto/cipher_extra/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt",
   "crypto/cipher_extra/test/aes_128_cbc_sha1_tls_tests.txt",
   "crypto/cipher_extra/test/aes_128_ccm_bluetooth_8_tests.txt",
@@ -804,13 +787,30 @@
   "crypto/dilithium/dilithium_tests.txt",
   "crypto/dilithium/edge_cases_draft_dilithium3_sign.txt",
   "crypto/dilithium/edge_cases_draft_dilithium3_verify.txt",
-  "crypto/ec_extra/ec_scalar_base_mult_tests.txt",
   "crypto/ec_extra/p256-nistz_tests.txt",
   "crypto/ecdh_extra/ecdh_tests.txt",
-  "crypto/ecdsa_extra/ecdsa_sign_tests.txt",
-  "crypto/ecdsa_extra/ecdsa_verify_tests.txt",
   "crypto/evp/evp_tests.txt",
   "crypto/evp/scrypt_tests.txt",
+  "crypto/fipsmodule/aes/aes_tests.txt",
+  "crypto/fipsmodule/bn/test/exp_tests.txt",
+  "crypto/fipsmodule/bn/test/gcd_tests.txt",
+  "crypto/fipsmodule/bn/test/miller_rabin_tests.txt",
+  "crypto/fipsmodule/bn/test/mod_exp_tests.txt",
+  "crypto/fipsmodule/bn/test/mod_inv_tests.txt",
+  "crypto/fipsmodule/bn/test/mod_mul_tests.txt",
+  "crypto/fipsmodule/bn/test/mod_sqrt_tests.txt",
+  "crypto/fipsmodule/bn/test/product_tests.txt",
+  "crypto/fipsmodule/bn/test/quotient_tests.txt",
+  "crypto/fipsmodule/bn/test/shift_tests.txt",
+  "crypto/fipsmodule/bn/test/sum_tests.txt",
+  "crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt",
+  "crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt",
+  "crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt",
+  "crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt",
+  "crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt",
+  "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
+  "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
+  "crypto/fipsmodule/modes/gcm_tests.txt",
   "crypto/hmac_extra/hmac_tests.txt",
   "crypto/hpke/hpke_test_vectors.txt",
   "crypto/keccak/keccak_tests.txt",
diff --git a/gen/sources.cmake b/gen/sources.cmake
index 3388deb..390cc6e 100644
--- a/gen/sources.cmake
+++ b/gen/sources.cmake
@@ -778,23 +778,6 @@
   CRYPTO_TEST_DATA
 
   crypto/blake2/blake2b256_tests.txt
-  crypto/bn_extra/test/exp_tests.txt
-  crypto/bn_extra/test/gcd_tests.txt
-  crypto/bn_extra/test/miller_rabin_tests.txt
-  crypto/bn_extra/test/mod_exp_tests.txt
-  crypto/bn_extra/test/mod_inv_tests.txt
-  crypto/bn_extra/test/mod_mul_tests.txt
-  crypto/bn_extra/test/mod_sqrt_tests.txt
-  crypto/bn_extra/test/product_tests.txt
-  crypto/bn_extra/test/quotient_tests.txt
-  crypto/bn_extra/test/shift_tests.txt
-  crypto/bn_extra/test/sum_tests.txt
-  crypto/cipher_extra/aes_tests.txt
-  crypto/cipher_extra/cavp_3des_cmac_tests.txt
-  crypto/cipher_extra/cavp_aes128_cmac_tests.txt
-  crypto/cipher_extra/cavp_aes192_cmac_tests.txt
-  crypto/cipher_extra/cavp_aes256_cmac_tests.txt
-  crypto/cipher_extra/gcm_tests.txt
   crypto/cipher_extra/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt
   crypto/cipher_extra/test/aes_128_cbc_sha1_tls_tests.txt
   crypto/cipher_extra/test/aes_128_ccm_bluetooth_8_tests.txt
@@ -830,13 +813,30 @@
   crypto/dilithium/dilithium_tests.txt
   crypto/dilithium/edge_cases_draft_dilithium3_sign.txt
   crypto/dilithium/edge_cases_draft_dilithium3_verify.txt
-  crypto/ec_extra/ec_scalar_base_mult_tests.txt
   crypto/ec_extra/p256-nistz_tests.txt
   crypto/ecdh_extra/ecdh_tests.txt
-  crypto/ecdsa_extra/ecdsa_sign_tests.txt
-  crypto/ecdsa_extra/ecdsa_verify_tests.txt
   crypto/evp/evp_tests.txt
   crypto/evp/scrypt_tests.txt
+  crypto/fipsmodule/aes/aes_tests.txt
+  crypto/fipsmodule/bn/test/exp_tests.txt
+  crypto/fipsmodule/bn/test/gcd_tests.txt
+  crypto/fipsmodule/bn/test/miller_rabin_tests.txt
+  crypto/fipsmodule/bn/test/mod_exp_tests.txt
+  crypto/fipsmodule/bn/test/mod_inv_tests.txt
+  crypto/fipsmodule/bn/test/mod_mul_tests.txt
+  crypto/fipsmodule/bn/test/mod_sqrt_tests.txt
+  crypto/fipsmodule/bn/test/product_tests.txt
+  crypto/fipsmodule/bn/test/quotient_tests.txt
+  crypto/fipsmodule/bn/test/shift_tests.txt
+  crypto/fipsmodule/bn/test/sum_tests.txt
+  crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt
+  crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt
+  crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt
+  crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt
+  crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt
+  crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt
+  crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt
+  crypto/fipsmodule/modes/gcm_tests.txt
   crypto/hmac_extra/hmac_tests.txt
   crypto/hpke/hpke_test_vectors.txt
   crypto/keccak/keccak_tests.txt
diff --git a/gen/sources.json b/gen/sources.json
index af09a82..f673138 100644
--- a/gen/sources.json
+++ b/gen/sources.json
@@ -732,23 +732,6 @@
     ],
     "data": [
       "crypto/blake2/blake2b256_tests.txt",
-      "crypto/bn_extra/test/exp_tests.txt",
-      "crypto/bn_extra/test/gcd_tests.txt",
-      "crypto/bn_extra/test/miller_rabin_tests.txt",
-      "crypto/bn_extra/test/mod_exp_tests.txt",
-      "crypto/bn_extra/test/mod_inv_tests.txt",
-      "crypto/bn_extra/test/mod_mul_tests.txt",
-      "crypto/bn_extra/test/mod_sqrt_tests.txt",
-      "crypto/bn_extra/test/product_tests.txt",
-      "crypto/bn_extra/test/quotient_tests.txt",
-      "crypto/bn_extra/test/shift_tests.txt",
-      "crypto/bn_extra/test/sum_tests.txt",
-      "crypto/cipher_extra/aes_tests.txt",
-      "crypto/cipher_extra/cavp_3des_cmac_tests.txt",
-      "crypto/cipher_extra/cavp_aes128_cmac_tests.txt",
-      "crypto/cipher_extra/cavp_aes192_cmac_tests.txt",
-      "crypto/cipher_extra/cavp_aes256_cmac_tests.txt",
-      "crypto/cipher_extra/gcm_tests.txt",
       "crypto/cipher_extra/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt",
       "crypto/cipher_extra/test/aes_128_cbc_sha1_tls_tests.txt",
       "crypto/cipher_extra/test/aes_128_ccm_bluetooth_8_tests.txt",
@@ -784,13 +767,30 @@
       "crypto/dilithium/dilithium_tests.txt",
       "crypto/dilithium/edge_cases_draft_dilithium3_sign.txt",
       "crypto/dilithium/edge_cases_draft_dilithium3_verify.txt",
-      "crypto/ec_extra/ec_scalar_base_mult_tests.txt",
       "crypto/ec_extra/p256-nistz_tests.txt",
       "crypto/ecdh_extra/ecdh_tests.txt",
-      "crypto/ecdsa_extra/ecdsa_sign_tests.txt",
-      "crypto/ecdsa_extra/ecdsa_verify_tests.txt",
       "crypto/evp/evp_tests.txt",
       "crypto/evp/scrypt_tests.txt",
+      "crypto/fipsmodule/aes/aes_tests.txt",
+      "crypto/fipsmodule/bn/test/exp_tests.txt",
+      "crypto/fipsmodule/bn/test/gcd_tests.txt",
+      "crypto/fipsmodule/bn/test/miller_rabin_tests.txt",
+      "crypto/fipsmodule/bn/test/mod_exp_tests.txt",
+      "crypto/fipsmodule/bn/test/mod_inv_tests.txt",
+      "crypto/fipsmodule/bn/test/mod_mul_tests.txt",
+      "crypto/fipsmodule/bn/test/mod_sqrt_tests.txt",
+      "crypto/fipsmodule/bn/test/product_tests.txt",
+      "crypto/fipsmodule/bn/test/quotient_tests.txt",
+      "crypto/fipsmodule/bn/test/shift_tests.txt",
+      "crypto/fipsmodule/bn/test/sum_tests.txt",
+      "crypto/fipsmodule/cmac/cavp_3des_cmac_tests.txt",
+      "crypto/fipsmodule/cmac/cavp_aes128_cmac_tests.txt",
+      "crypto/fipsmodule/cmac/cavp_aes192_cmac_tests.txt",
+      "crypto/fipsmodule/cmac/cavp_aes256_cmac_tests.txt",
+      "crypto/fipsmodule/ec/ec_scalar_base_mult_tests.txt",
+      "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
+      "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
+      "crypto/fipsmodule/modes/gcm_tests.txt",
       "crypto/hmac_extra/hmac_tests.txt",
       "crypto/hpke/hpke_test_vectors.txt",
       "crypto/keccak/keccak_tests.txt",