Bug 1334106 - improve mpi fuzzing, r=bustage
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Mon, 21 Aug 2017 07:16:17 +0200
changeset 13536 f4666e28214bfed32f67d0f8255a22b50f3bc403
parent 13534 b05b124f610577e8bdbd77d86f1ab894df9cdf8d
child 13537 317881476c6e08be5c1e561c0c032d7b3f40d1c2
push id2329
push userfranziskuskiefer@gmail.com
push dateMon, 21 Aug 2017 05:18:07 +0000
reviewersbustage
bugs1334106
Bug 1334106 - improve mpi fuzzing, r=bustage
fuzz/mpi_expmod_target.cc
--- a/fuzz/mpi_expmod_target.cc
+++ b/fuzz/mpi_expmod_target.cc
@@ -14,20 +14,20 @@ extern "C" int LLVMFuzzerTestOneInput(co
   if (size < 3) {
     return 0;
   }
   INIT_FOUR_NUMBERS
 
   auto modulus = get_modulus(data, size, ctx);
   // Compare with OpenSSL exp mod
   m1 = &std::get<1>(modulus);
-  check_equal(A, &a, max_size);
-  check_equal(B, &b, max_size);
-  check_equal(std::get<0>(modulus), m1, max_size);
   print_bn("A", A);
   print_bn("B", B);
   print_bn("m", std::get<0>(modulus));
+  check_equal(A, &a, max_size);
+  check_equal(B, &b, max_size);
+  check_equal(std::get<0>(modulus), m1, 3 * max_size);
   assert(mp_exptmod(&a, &b, m1, &c) == MP_OKAY);
   (void)BN_mod_exp(C, A, B, std::get<0>(modulus), ctx);
   check_equal(C, &c, 2 * max_size);
 
   CLEANUP_AND_RETURN
 }