Remove redundant GCM tests

The test vectors in gcm_tests.txt are just AES-GCM test vectors, all of
which are already present in our existing AES-GCM test vector files. To
test it we were just reimplementing AES-GCM with the low-level GCM bits.

With that, the only code remaining in gcm_test.cc was code we wrote,
added in 2019 in
https://boringssl-review.googlesource.com/c/boringssl/+/34266.

(Plus, with the exception of the last two, the test vectors, which used
to be embedded in the file, are actually just NIST test vectors. The
test driver code itself, since removed, does not appear to ever have
been derived from OpenSSL.)

This also removes the need to export the internal functions out of the
shared library build. (Though, in general, we probably should just be
turning those tests off in shared library builds.)

Change-Id: Ibb2b54f3c044a75a147f9fe8cc040b60e9a97482
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/73787
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
diff --git a/build.json b/build.json
index dcb03ce..e3bbb1d 100644
--- a/build.json
+++ b/build.json
@@ -905,7 +905,6 @@
             "crypto/fipsmodule/ec/p256-nistz_tests.txt",
             "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
             "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
-            "crypto/fipsmodule/modes/gcm_tests.txt",
             "crypto/fipsmodule/rand/ctrdrbg_vectors.txt",
             "crypto/hmac_extra/hmac_tests.txt",
             "crypto/hpke/hpke_test_vectors.txt",
diff --git a/crypto/fipsmodule/modes/gcm_test.cc b/crypto/fipsmodule/modes/gcm_test.cc
index 3f92a62..1729e0d 100644
--- a/crypto/fipsmodule/modes/gcm_test.cc
+++ b/crypto/fipsmodule/modes/gcm_test.cc
@@ -1,55 +1,16 @@
-/* ====================================================================
- * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
+/* Copyright (c) 2019, Google Inc.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgment:
- *    "This product includes software developed by the OpenSSL Project
- *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
- *
- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission. For written permission, please contact
- *    openssl-core@openssl.org.
- *
- * 5. Products derived from this software may not be called "OpenSSL"
- *    nor may "OpenSSL" appear in their names without prior written
- *    permission of the OpenSSL Project.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by the OpenSSL Project
- *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
- *
- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ==================================================================== */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <vector>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
 #include <gtest/gtest.h>
 
@@ -57,62 +18,10 @@
 
 #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) {
-  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"));
-    ASSERT_TRUE(t->GetBytes(&plaintext, "Plaintext"));
-    ASSERT_TRUE(t->GetBytes(&additional_data, "AdditionalData"));
-    ASSERT_TRUE(t->GetBytes(&nonce, "Nonce"));
-    ASSERT_TRUE(t->GetBytes(&ciphertext, "Ciphertext"));
-    ASSERT_TRUE(t->GetBytes(&tag, "Tag"));
-
-    ASSERT_EQ(plaintext.size(), ciphertext.size());
-    ASSERT_TRUE(key.size() == 16 || key.size() == 24 || key.size() == 32);
-    ASSERT_EQ(16u, tag.size());
-
-    std::vector<uint8_t> out(plaintext.size());
-    AES_KEY aes_key;
-    ASSERT_EQ(0, AES_set_encrypt_key(key.data(), key.size() * 8, &aes_key));
-
-    GCM128_CONTEXT ctx;
-    OPENSSL_memset(&ctx, 0, sizeof(ctx));
-    CRYPTO_gcm128_init_key(&ctx.gcm_key, &aes_key, AES_encrypt, 0);
-    CRYPTO_gcm128_setiv(&ctx, &aes_key, nonce.data(), nonce.size());
-    if (!additional_data.empty()) {
-      CRYPTO_gcm128_aad(&ctx, additional_data.data(), additional_data.size());
-    }
-    if (!plaintext.empty()) {
-      CRYPTO_gcm128_encrypt(&ctx, &aes_key, plaintext.data(), out.data(),
-                            plaintext.size());
-    }
-
-    std::vector<uint8_t> got_tag(tag.size());
-    CRYPTO_gcm128_tag(&ctx, got_tag.data(), got_tag.size());
-    EXPECT_EQ(Bytes(tag), Bytes(got_tag));
-    EXPECT_EQ(Bytes(ciphertext), Bytes(out));
-
-    CRYPTO_gcm128_setiv(&ctx, &aes_key, nonce.data(), nonce.size());
-    OPENSSL_memset(out.data(), 0, out.size());
-    if (!additional_data.empty()) {
-      CRYPTO_gcm128_aad(&ctx, additional_data.data(), additional_data.size());
-    }
-    if (!ciphertext.empty()) {
-      CRYPTO_gcm128_decrypt(&ctx, &aes_key, ciphertext.data(), out.data(),
-                            ciphertext.size());
-    }
-    ASSERT_TRUE(CRYPTO_gcm128_finish(&ctx, tag.data(), tag.size()));
-    EXPECT_EQ(Bytes(plaintext), Bytes(out));
-  });
-}
-
 #if defined(SUPPORTS_ABI_TEST) && !defined(OPENSSL_NO_ASM)
 TEST(GCMTest, ABI) {
   static const uint64_t kH[2] = {
diff --git a/crypto/fipsmodule/modes/gcm_tests.txt b/crypto/fipsmodule/modes/gcm_tests.txt
deleted file mode 100644
index 68b3d07..0000000
--- a/crypto/fipsmodule/modes/gcm_tests.txt
+++ /dev/null
@@ -1,147 +0,0 @@
-Key = 00000000000000000000000000000000
-Plaintext = 
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = 
-Tag = 58e2fccefa7e3061367f1d57a4e7455a
-
-Key = 00000000000000000000000000000000
-Plaintext = 00000000000000000000000000000000
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = 0388dace60b6a392f328c2b971b2fe78
-Tag = ab6e47d42cec13bdf53a67b21257bddf
-
-Key = feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
-AdditionalData = 
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985
-Tag = 4d5c2af327cd64a62cf35abd2ba6fab4
-
-Key = feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091
-Tag = 5bc94fbc3221a5db94fae95ae7121a47
-
-Key = feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbad
-Ciphertext = 61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598
-Tag = 3612d2e79e3b0785561be14aaca2fccb
-
-Key = feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
-Ciphertext = 8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5
-Tag = 619cc5aefffe0bfa462af43c1699d050
-
-Key = 000000000000000000000000000000000000000000000000
-Plaintext = 
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = 
-Tag = cd33b28ac773f74ba00ed1f312572435
-
-Key = 000000000000000000000000000000000000000000000000
-Plaintext = 00000000000000000000000000000000
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = 98e7247c07f0fe411c267e4384b0f600
-Tag = 2ff58d80033927ab8ef4d4587514f0fb
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
-AdditionalData = 
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256
-Tag = 9924a7c8587336bfb118024db8674a14
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710
-Tag = 2519498e80f1478f37ba55bd6d27618c
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbad
-Ciphertext = 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7
-Tag = 65dcc57fcf623a24094fcca40d3533f8
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbad
-Ciphertext = 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7
-Tag = 65dcc57fcf623a24094fcca40d3533f8
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
-Ciphertext = d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e4581e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b
-Tag = dcf566ff291c25bbb8568fc3d376a6d9
-
-Key = 0000000000000000000000000000000000000000000000000000000000000000
-Plaintext = 
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = 
-Tag = 530f8afbc74536b9a963b4f1c4cb738b
-
-Key = 0000000000000000000000000000000000000000000000000000000000000000
-Plaintext = 00000000000000000000000000000000
-AdditionalData = 
-Nonce = 000000000000000000000000
-Ciphertext = cea7403d4d606b6e074ec5d3baf39d18
-Tag = d0d1c8a799996bf0265b98b5d48ab919
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
-AdditionalData = 
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad
-Tag = b094dac5d93471bdec1a502270e3cc6c
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbaddecaf888
-Ciphertext = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662
-Tag = 76fc6ece0f4e1768cddf8853bb2d551b
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = cafebabefacedbad
-Ciphertext = c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f
-Tag = 3a337dbf46a792c45e454913fe2ea8f2
-
-Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
-Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
-AdditionalData = feedfacedeadbeeffeedfacedeadbeefabaddad2
-Nonce = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
-Ciphertext = 5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f
-Tag = a44a8266ee1c8eb0c8b5d4cf5ae9f19a
-
-Key = 00000000000000000000000000000000
-Plaintext = 
-AdditionalData = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad
-Nonce = 000000000000000000000000
-Ciphertext = 
-Tag = 5fea793a2d6f974d37e68e0cb8ff9492
-
-Key = 00000000000000000000000000000000
-Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-AdditionalData = 
-# This nonce results in 0xfff in counter LSB.
-Nonce = ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-Ciphertext = 56b3373ca9ef6e4a2b64fe1e9a17b61425f10d47a75a5fce13efc6bc784af24f4141bdd48cf7c770887afd573cca5418a9aeffcd7c5ceddfc6a78397b9a85b499da558257267caab2ad0b23ca476a53cb17fb41c4b8b475cb4f3f7165094c229c9e8c4dc0a2a5ff1903e501511221376a1cdb8364c5061a20cae74bc4acd76ceb0abc9fd3217ef9f8c90be402ddf6d8697f4f880dff15bfb7a6b28241ec8fe183c2d59e3f9dfff653c7126f0acb9e64211f42bae12af462b1070bef1ab5e3606872ca10dee15b3249b1a1b958f23134c4bccb7d03200bce420a2f8eb66dcf3644d1423c1b5699003c13ecef4bf38a3b60eedc34033bac1902783dc6d89e2e774188a439c7ebcc0672dbda4ddcfb2794613b0be41315ef778708a70ee7d75165c
-Tag = 8b307f6b33286d0ab026a9ed3fe1e85f
diff --git a/crypto/fipsmodule/modes/internal.h b/crypto/fipsmodule/modes/internal.h
index 3b84015..601dab7 100644
--- a/crypto/fipsmodule/modes/internal.h
+++ b/crypto/fipsmodule/modes/internal.h
@@ -190,64 +190,56 @@
 
 // CRYPTO_gcm128_init_key initialises |gcm_key| to use |block| (typically AES)
 // with the given key. |block_is_hwaes| is one if |block| is |aes_hw_encrypt|.
-OPENSSL_EXPORT void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key,
-                                           const AES_KEY *key, block128_f block,
-                                           int block_is_hwaes);
+void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key, const AES_KEY *key,
+                            block128_f block, int block_is_hwaes);
 
 // CRYPTO_gcm128_setiv sets the IV (nonce) for |ctx|. The |key| must be the
 // same key that was passed to |CRYPTO_gcm128_init|.
-OPENSSL_EXPORT void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-                                        const uint8_t *iv, size_t iv_len);
+void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
+                         const uint8_t *iv, size_t iv_len);
 
 // CRYPTO_gcm128_aad sets the authenticated data for an instance of GCM.
 // This must be called before and data is encrypted. It returns one on success
 // and zero otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad,
-                                     size_t len);
+int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len);
 
 // CRYPTO_gcm128_encrypt encrypts |len| bytes from |in| to |out|. The |key|
 // must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one
 // on success and zero otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
-                                         const AES_KEY *key, const uint8_t *in,
-                                         uint8_t *out, size_t len);
+int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
+                          const uint8_t *in, uint8_t *out, size_t len);
 
 // CRYPTO_gcm128_decrypt decrypts |len| bytes from |in| to |out|. The |key|
 // must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one
 // on success and zero otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
-                                         const AES_KEY *key, const uint8_t *in,
-                                         uint8_t *out, size_t len);
+int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
+                          const uint8_t *in, uint8_t *out, size_t len);
 
 // CRYPTO_gcm128_encrypt_ctr32 encrypts |len| bytes from |in| to |out| using
 // a CTR function that only handles the bottom 32 bits of the nonce, like
 // |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was
 // passed to |CRYPTO_gcm128_init|. It returns one on success and zero
 // otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
-                                               const AES_KEY *key,
-                                               const uint8_t *in, uint8_t *out,
-                                               size_t len, ctr128_f stream);
+int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
+                                const uint8_t *in, uint8_t *out, size_t len,
+                                ctr128_f stream);
 
 // CRYPTO_gcm128_decrypt_ctr32 decrypts |len| bytes from |in| to |out| using
 // a CTR function that only handles the bottom 32 bits of the nonce, like
 // |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was
 // passed to |CRYPTO_gcm128_init|. It returns one on success and zero
 // otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
-                                               const AES_KEY *key,
-                                               const uint8_t *in, uint8_t *out,
-                                               size_t len, ctr128_f stream);
+int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
+                                const uint8_t *in, uint8_t *out, size_t len,
+                                ctr128_f stream);
 
 // CRYPTO_gcm128_finish calculates the authenticator and compares it against
 // |len| bytes of |tag|. It returns one on success and zero otherwise.
-OPENSSL_EXPORT int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag,
-                                        size_t len);
+int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len);
 
 // CRYPTO_gcm128_tag calculates the authenticator and copies it into |tag|.
 // The minimum of |len| and 16 bytes are copied into |tag|.
-OPENSSL_EXPORT void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag,
-                                      size_t len);
+void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag, size_t len);
 
 
 // GCM assembly.
diff --git a/gen/sources.bzl b/gen/sources.bzl
index 4024735..18f7ae3 100644
--- a/gen/sources.bzl
+++ b/gen/sources.bzl
@@ -839,7 +839,6 @@
     "crypto/fipsmodule/ec/p256-nistz_tests.txt",
     "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
     "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
-    "crypto/fipsmodule/modes/gcm_tests.txt",
     "crypto/fipsmodule/rand/ctrdrbg_vectors.txt",
     "crypto/hmac_extra/hmac_tests.txt",
     "crypto/hpke/hpke_test_vectors.txt",
diff --git a/gen/sources.cmake b/gen/sources.cmake
index ea33e32..010a434 100644
--- a/gen/sources.cmake
+++ b/gen/sources.cmake
@@ -865,7 +865,6 @@
   crypto/fipsmodule/ec/p256-nistz_tests.txt
   crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt
   crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt
-  crypto/fipsmodule/modes/gcm_tests.txt
   crypto/fipsmodule/rand/ctrdrbg_vectors.txt
   crypto/hmac_extra/hmac_tests.txt
   crypto/hpke/hpke_test_vectors.txt
diff --git a/gen/sources.gni b/gen/sources.gni
index 6fb50e9..7d5a964 100644
--- a/gen/sources.gni
+++ b/gen/sources.gni
@@ -839,7 +839,6 @@
   "crypto/fipsmodule/ec/p256-nistz_tests.txt",
   "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
   "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
-  "crypto/fipsmodule/modes/gcm_tests.txt",
   "crypto/fipsmodule/rand/ctrdrbg_vectors.txt",
   "crypto/hmac_extra/hmac_tests.txt",
   "crypto/hpke/hpke_test_vectors.txt",
diff --git a/gen/sources.json b/gen/sources.json
index 9e52ec4..b1b65dd 100644
--- a/gen/sources.json
+++ b/gen/sources.json
@@ -819,7 +819,6 @@
       "crypto/fipsmodule/ec/p256-nistz_tests.txt",
       "crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
       "crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
-      "crypto/fipsmodule/modes/gcm_tests.txt",
       "crypto/fipsmodule/rand/ctrdrbg_vectors.txt",
       "crypto/hmac_extra/hmac_tests.txt",
       "crypto/hpke/hpke_test_vectors.txt",