Generate bn_div and bn_mod_exp corpus from bn_tests.txt.
Also switch them to accepting a u16 length prefix. We appear not to have
any such tests right now, but RSA-2048 would involve modulus well larger
and primes just a hair larger than a u8 length prefix alows.
Change-Id: Icce8f1d976e159b945302fbba732e72913c7b724
Reviewed-on: https://boringssl-review.googlesource.com/22284
Commit-Queue: Steven Valdez <svaldez@google.com>
Reviewed-by: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/fuzz/bn_div.cc b/fuzz/bn_div.cc
index 8994826..16b060e 100644
--- a/fuzz/bn_div.cc
+++ b/fuzz/bn_div.cc
@@ -28,10 +28,10 @@
CBS cbs, child0, child1;
uint8_t sign0, sign1;
CBS_init(&cbs, buf, len);
- if (!CBS_get_u8_length_prefixed(&cbs, &child0) ||
+ if (!CBS_get_u16_length_prefixed(&cbs, &child0) ||
!CBS_get_u8(&child0, &sign0) ||
CBS_len(&child0) == 0 ||
- !CBS_get_u8_length_prefixed(&cbs, &child1) ||
+ !CBS_get_u16_length_prefixed(&cbs, &child1) ||
!CBS_get_u8(&child1, &sign1) ||
CBS_len(&child1) == 0) {
return 0;