aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBob Beck <bbe@google.com>2024-05-29 19:43:44 +0000
committerDavid Benjamin <davidben@google.com>2024-05-29 19:47:04 +0000
commit9540c0452343e684f94515288880b6b35655f792 (patch)
treea67830f8097f0148617f9ec3d3cf486d065df1c4 /crypto
parented3f05a6794adfd39937d0027afefad8f6afcae9 (diff)
downloadboringssl-9540c0452343e684f94515288880b6b35655f792.zip
boringssl-9540c0452343e684f94515288880b6b35655f792.tar.gz
boringssl-9540c0452343e684f94515288880b6b35655f792.tar.bz2
Revert "Move unit tests out of bcm/fipsmodule"
This reverts commit e09fcf8302f75dc50afcfe40f0d59a92b40a3c2e. Change-Id: Ib15912481ac25fd60e7e4806d9b6bd5be8e62db8 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68809 Auto-Submit: Bob Beck <bbe@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/fipsmodule/aes/aes_test.cc (renamed from crypto/cipher_extra/aes_test.cc)11
-rw-r--r--crypto/fipsmodule/bn/bn_test.cc (renamed from crypto/bn_extra/bn_test.cc)13
-rw-r--r--crypto/fipsmodule/cmac/cmac_test.cc (renamed from crypto/cipher_extra/cmac_test.cc)6
-rw-r--r--crypto/fipsmodule/ec/ec_test.cc (renamed from crypto/ec_extra/ec_test.cc)8
-rw-r--r--crypto/fipsmodule/ec/p256-nistz_test.cc (renamed from crypto/ec_extra/p256-nistz_test.cc)13
-rw-r--r--crypto/fipsmodule/ec/p256-nistz_tests.txt (renamed from crypto/ec_extra/p256-nistz_tests.txt)0
-rw-r--r--crypto/fipsmodule/ec/p256_test.cc (renamed from crypto/ec_extra/p256_test.cc)6
-rw-r--r--crypto/fipsmodule/ecdsa/ecdsa_test.cc (renamed from crypto/ecdsa_extra/ecdsa_test.cc)6
-rw-r--r--crypto/fipsmodule/hkdf/hkdf_test.cc (renamed from crypto/cipher_extra/hkdf_test.cc)6
-rw-r--r--crypto/fipsmodule/md5/md5_test.cc (renamed from crypto/cipher_extra/md5_test.cc)3
-rw-r--r--crypto/fipsmodule/modes/gcm_test.cc (renamed from crypto/cipher_extra/gcm_test.cc)11
-rw-r--r--crypto/fipsmodule/rand/ctrdrbg_test.cc (renamed from crypto/rand_extra/ctrdrbg_test.cc)8
-rw-r--r--crypto/fipsmodule/rand/ctrdrbg_vectors.txt (renamed from crypto/rand_extra/ctrdrbg_vectors.txt)0
-rw-r--r--crypto/fipsmodule/rand/fork_detect_test.cc (renamed from crypto/rand_extra/fork_detect_test.cc)2
-rw-r--r--crypto/fipsmodule/rand/urandom_test.cc (renamed from crypto/rand_extra/urandom_test.cc)3
-rw-r--r--crypto/fipsmodule/sha/sha_test.cc (renamed from crypto/cipher_extra/sha_test.cc)6
16 files changed, 55 insertions, 47 deletions
diff --git a/crypto/cipher_extra/aes_test.cc b/crypto/fipsmodule/aes/aes_test.cc
index 47e5666..d4a458b 100644
--- a/crypto/cipher_extra/aes_test.cc
+++ b/crypto/fipsmodule/aes/aes_test.cc
@@ -25,11 +25,12 @@
#include <openssl/aes.h>
#include <openssl/rand.h>
-#include "../fipsmodule/aes/internal.h"
-#include "../test/abi_test.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../test/wycheproof_util.h"
+#include "internal.h"
+#include "../../internal.h"
+#include "../../test/abi_test.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../../test/wycheproof_util.h"
static void TestRaw(FileTest *t) {
diff --git a/crypto/bn_extra/bn_test.cc b/crypto/fipsmodule/bn/bn_test.cc
index 47af50d..710b60f 100644
--- a/crypto/bn_extra/bn_test.cc
+++ b/crypto/fipsmodule/bn/bn_test.cc
@@ -87,12 +87,13 @@
#include <openssl/mem.h>
#include <openssl/rand.h>
-#include "../fipsmodule/bn/internal.h"
-#include "../internal.h"
-#include "../test/abi_test.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../test/wycheproof_util.h"
+#include "./internal.h"
+#include "./rsaz_exp.h"
+#include "../../internal.h"
+#include "../../test/abi_test.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../../test/wycheproof_util.h"
static int HexToBIGNUM(bssl::UniquePtr<BIGNUM> *out, const char *in) {
diff --git a/crypto/cipher_extra/cmac_test.cc b/crypto/fipsmodule/cmac/cmac_test.cc
index f6da0eb..9e3744e 100644
--- a/crypto/cipher_extra/cmac_test.cc
+++ b/crypto/fipsmodule/cmac/cmac_test.cc
@@ -23,9 +23,9 @@
#include <openssl/cmac.h>
#include <openssl/mem.h>
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../test/wycheproof_util.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../../test/wycheproof_util.h"
static void test(const char *name, const uint8_t *key, size_t key_len,
diff --git a/crypto/ec_extra/ec_test.cc b/crypto/fipsmodule/ec/ec_test.cc
index a9e8ffe..b9bc1a2 100644
--- a/crypto/ec_extra/ec_test.cc
+++ b/crypto/fipsmodule/ec/ec_test.cc
@@ -30,9 +30,11 @@
#include <openssl/obj.h>
#include <openssl/span.h>
-#include "./internal.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
+#include "../../ec_extra/internal.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../bn/internal.h"
+#include "internal.h"
// kECKeyWithoutPublic is an ECPrivateKey with the optional publicKey field
diff --git a/crypto/ec_extra/p256-nistz_test.cc b/crypto/fipsmodule/ec/p256-nistz_test.cc
index 11d99a4..263db50 100644
--- a/crypto/ec_extra/p256-nistz_test.cc
+++ b/crypto/fipsmodule/ec/p256-nistz_test.cc
@@ -25,11 +25,12 @@
#include <openssl/nid.h>
#include "internal.h"
-#include "../internal.h"
-#include "../test/abi_test.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../fipsmodule/ec/p256-nistz.h"
+#include "../bn/internal.h"
+#include "../../internal.h"
+#include "../../test/abi_test.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "p256-nistz.h"
// Disable tests if BORINGSSL_SHARED_LIBRARY is defined. These tests need access
@@ -486,7 +487,7 @@ static void TestOrdMulMont(FileTest *t) {
}
TEST(P256_NistzTest, TestVectors) {
- return FileTestGTest("crypto/ec_extra/p256-nistz_tests.txt",
+ return FileTestGTest("crypto/fipsmodule/ec/p256-nistz_tests.txt",
[](FileTest *t) {
if (t->GetParameter() == "Negate") {
TestNegate(t);
diff --git a/crypto/ec_extra/p256-nistz_tests.txt b/crypto/fipsmodule/ec/p256-nistz_tests.txt
index 8bc301e..8bc301e 100644
--- a/crypto/ec_extra/p256-nistz_tests.txt
+++ b/crypto/fipsmodule/ec/p256-nistz_tests.txt
diff --git a/crypto/ec_extra/p256_test.cc b/crypto/fipsmodule/ec/p256_test.cc
index 7fc1c80..2af9319 100644
--- a/crypto/ec_extra/p256_test.cc
+++ b/crypto/fipsmodule/ec/p256_test.cc
@@ -13,13 +13,13 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#include <gtest/gtest.h>
-#include "../internal.h"
-#include "../test/abi_test.h"
+#include "../../internal.h"
+#include "../../test/abi_test.h"
#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) && defined(__x86_64__) && \
defined(SUPPORTS_ABI_TEST)
extern "C" {
-#include "../../third_party/fiat/p256_64.h"
+#include "../../../third_party/fiat/p256_64.h"
}
TEST(P256Test, AdxMulABI) {
diff --git a/crypto/ecdsa_extra/ecdsa_test.cc b/crypto/fipsmodule/ecdsa/ecdsa_test.cc
index 53d7bc2..5876935 100644
--- a/crypto/ecdsa_extra/ecdsa_test.cc
+++ b/crypto/fipsmodule/ecdsa/ecdsa_test.cc
@@ -64,9 +64,9 @@
#include <openssl/nid.h>
#include <openssl/rand.h>
-//#include "../ec/internal.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
+#include "../ec/internal.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
static bssl::UniquePtr<BIGNUM> HexToBIGNUM(const char *hex) {
diff --git a/crypto/cipher_extra/hkdf_test.cc b/crypto/fipsmodule/hkdf/hkdf_test.cc
index 8aad6c8..dd7dd58 100644
--- a/crypto/cipher_extra/hkdf_test.cc
+++ b/crypto/fipsmodule/hkdf/hkdf_test.cc
@@ -20,9 +20,9 @@
#include <gtest/gtest.h>
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../test/wycheproof_util.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../../test/wycheproof_util.h"
struct HKDFTestVector {
diff --git a/crypto/cipher_extra/md5_test.cc b/crypto/fipsmodule/md5/md5_test.cc
index 4ad6b8c..7df5bb2 100644
--- a/crypto/cipher_extra/md5_test.cc
+++ b/crypto/fipsmodule/md5/md5_test.cc
@@ -16,7 +16,8 @@
#include <gtest/gtest.h>
-#include "../test/abi_test.h"
+#include "internal.h"
+#include "../../test/abi_test.h"
#if defined(MD5_ASM) && defined(SUPPORTS_ABI_TEST)
diff --git a/crypto/cipher_extra/gcm_test.cc b/crypto/fipsmodule/modes/gcm_test.cc
index 456ce99..b4f9b90 100644
--- a/crypto/cipher_extra/gcm_test.cc
+++ b/crypto/fipsmodule/modes/gcm_test.cc
@@ -55,11 +55,12 @@
#include <openssl/aes.h>
-#include "../test/abi_test.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
-#include "../fipsmodule/aes/internal.h"
-#include "../fipsmodule/modes/internal.h"
+#include "../../internal.h"
+#include "../../test/abi_test.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
+#include "../aes/internal.h"
+#include "internal.h"
TEST(GCMTest, TestVectors) {
diff --git a/crypto/rand_extra/ctrdrbg_test.cc b/crypto/fipsmodule/rand/ctrdrbg_test.cc
index 6950bb3..deed19f 100644
--- a/crypto/rand_extra/ctrdrbg_test.cc
+++ b/crypto/fipsmodule/rand/ctrdrbg_test.cc
@@ -17,9 +17,9 @@
#include <openssl/ctrdrbg.h>
#include <openssl/sha.h>
-#include "../fipsmodule/rand/internal.h"
-#include "../test/file_test.h"
-#include "../test/test_util.h"
+#include "internal.h"
+#include "../../test/file_test.h"
+#include "../../test/test_util.h"
TEST(CTRDRBGTest, Basic) {
@@ -94,7 +94,7 @@ TEST(CTRDRBGTest, Large) {
}
TEST(CTRDRBGTest, TestVectors) {
- FileTestGTest("crypto/rand_extra/ctrdrbg_vectors.txt", [](FileTest *t) {
+ FileTestGTest("crypto/fipsmodule/rand/ctrdrbg_vectors.txt", [](FileTest *t) {
std::vector<uint8_t> seed, personalisation, reseed, ai_reseed, ai1, ai2,
expected;
ASSERT_TRUE(t->GetBytes(&seed, "EntropyInput"));
diff --git a/crypto/rand_extra/ctrdrbg_vectors.txt b/crypto/fipsmodule/rand/ctrdrbg_vectors.txt
index c866431..c866431 100644
--- a/crypto/rand_extra/ctrdrbg_vectors.txt
+++ b/crypto/fipsmodule/rand/ctrdrbg_vectors.txt
diff --git a/crypto/rand_extra/fork_detect_test.cc b/crypto/fipsmodule/rand/fork_detect_test.cc
index bea1ec6..f9cde28 100644
--- a/crypto/rand_extra/fork_detect_test.cc
+++ b/crypto/fipsmodule/rand/fork_detect_test.cc
@@ -14,7 +14,7 @@
#include <openssl/base.h>
-#include "../fipsmodule/rand/fork_detect.h"
+#include "fork_detect.h"
// TSAN cannot cope with this test and complains that "starting new threads
// after multi-threaded fork is not supported".
diff --git a/crypto/rand_extra/urandom_test.cc b/crypto/fipsmodule/rand/urandom_test.cc
index 909d193..08e4183 100644
--- a/crypto/rand_extra/urandom_test.cc
+++ b/crypto/fipsmodule/rand/urandom_test.cc
@@ -19,7 +19,8 @@
#include <openssl/ctrdrbg.h>
#include <openssl/rand.h>
-#include "../fipsmodule/rand/getrandom_fillin.h"
+#include "getrandom_fillin.h"
+#include "internal.h"
#if (defined(OPENSSL_X86_64) || defined(OPENSSL_AARCH64)) && \
!defined(BORINGSSL_SHARED_LIBRARY) && defined(OPENSSL_RAND_URANDOM) && \
diff --git a/crypto/cipher_extra/sha_test.cc b/crypto/fipsmodule/sha/sha_test.cc
index e6a0488..5624288 100644
--- a/crypto/cipher_extra/sha_test.cc
+++ b/crypto/fipsmodule/sha/sha_test.cc
@@ -18,9 +18,9 @@
#include <gtest/gtest.h>
-#include "../fipsmodule/sha/internal.h"
-#include "../test/abi_test.h"
-#include "../test/test_util.h"
+#include "internal.h"
+#include "../../test/abi_test.h"
+#include "../../test/test_util.h"
TEST(SHATest, FIPS1862PRF) {