fipsoracle: Remove fax sample verification baked into test suites. This is covered by run_cavp.go.

Change-Id: If2514337bc444ec68e0f4ffeecb85e47b1ed9c09
Reviewed-on: https://boringssl-review.googlesource.com/15906
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/fipsoracle/cavp_aes_test.cc b/fipsoracle/cavp_aes_test.cc
index d116759..ad1d50c 100644
--- a/fipsoracle/cavp_aes_test.cc
+++ b/fipsoracle/cavp_aes_test.cc
@@ -13,8 +13,7 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
 // cavp_aes_test processes a NIST CAVP AES test vector request file and emits
-// the corresponding response. An optional sample vector file can be passed to
-// verify the result.
+// the corresponding response.
 
 #include <stdlib.h>
 
@@ -30,7 +29,6 @@
 
 struct TestCtx {
   const EVP_CIPHER *cipher;
-  std::unique_ptr<FileTest> response_sample;
   bool has_iv;
   enum Mode {
     kKAT,  // Known Answer Test
@@ -93,25 +91,6 @@
     printf("%s = %s\r\n\r\n", result_label.c_str(),
            EncodeHex(result.data(), result.size()).c_str());
 
-    // Check if sample response file matches.
-    if (ctx->response_sample) {
-      if (ctx->response_sample->ReadNext() != FileTest::kReadSuccess) {
-        t->PrintLine("invalid sample file");
-        return false;
-      }
-      std::string expected_count;
-      std::vector<uint8_t> expected_key, expected_result;
-      if (!ctx->response_sample->GetBytes(&expected_key, "KEY") ||
-          !t->ExpectBytesEqual(expected_key.data(), expected_key.size(),
-                               key.data(), key.size()) ||
-          !ctx->response_sample->GetBytes(&expected_result, result_label) ||
-          !t->ExpectBytesEqual(expected_result.data(), expected_result.size(),
-                               result.data(), result.size())) {
-        t->PrintLine("result doesn't match");
-        return false;
-      }
-    }
-
     const size_t key_len = key.size() * 8;
     if (key_len == 128) {
       for (size_t k = 0; k < key.size(); k++) {
@@ -187,30 +166,6 @@
         operation == kEncrypt ? "CIPHERTEXT" : "PLAINTEXT";
     printf("%s%s = %s\r\n\r\n", t->CurrentTestToString().c_str(), label.c_str(),
            EncodeHex(result.data(), result.size()).c_str());
-
-    // Check if sample response file matches.
-    if (ctx->response_sample) {
-      if (ctx->response_sample->ReadNext() != FileTest::kReadSuccess) {
-        t->PrintLine("invalid sample file");
-        return false;
-      }
-      std::string expected_count;
-      std::vector<uint8_t> expected_result;
-      if (!ctx->response_sample->GetAttribute(&expected_count, "COUNT") ||
-          count != expected_count ||
-          (operation == kEncrypt &&
-           (!ctx->response_sample->GetBytes(&expected_result, "CIPHERTEXT") ||
-            !t->ExpectBytesEqual(expected_result.data(), expected_result.size(),
-                                 result.data(), result.size()))) ||
-          (operation == kDecrypt &&
-           (!ctx->response_sample->GetBytes(&expected_result, "PLAINTEXT") ||
-            !t->ExpectBytesEqual(expected_result.data(), expected_result.size(),
-                                 result.data(), result.size())))) {
-        t->PrintLine("result doesn't match");
-        return false;
-      }
-    }
-
   } else {  // ctx->mode == kMCT
     const std::string op_label =
         operation == kEncrypt ? "[ENCRYPT]" : "[DECRYPT]";
@@ -229,14 +184,12 @@
 }
 
 static int usage(char *arg) {
-  fprintf(stderr,
-          "usage: %s (kat|mct) <cipher> <test file> [<sample response file>]\n",
-          arg);
+  fprintf(stderr, "usage: %s (kat|mct) <cipher> <test file>\n", arg);
   return 1;
 }
 
 int cavp_aes_test_main(int argc, char **argv) {
-  if (argc < 4 || argc > 5) {
+  if (argc != 4) {
     return usage(argv[0]);
   }
 
@@ -262,15 +215,7 @@
        cipher_name != "aes-192-ecb" &&
        cipher_name != "aes-256-ecb");
 
-  TestCtx ctx = {cipher, nullptr, has_iv, test_mode};
-
-  if (argc == 5) {
-    ctx.response_sample.reset(new FileTest(argv[4]));
-    if (!ctx.response_sample->is_open()) {
-      return 1;
-    }
-    ctx.response_sample->SetIgnoreUnusedAttributes(true);
-  }
+  TestCtx ctx = {cipher, has_iv, test_mode};
 
   printf("# Generated by");
   for (int i = 0; i < argc; i++) {