From 30bea14be6bbf77ed60acb9bd1befeb51d4c4b10 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Wed, 26 Apr 2017 12:39:46 -0400 Subject: [PATCH] Convert bntest to TEST_ framework Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/3265) --- test/bntest.c | 1328 +++++++++++++++++++------------------------- test/libtestutil.a | Bin 82398 -> 0 bytes 2 files changed, 582 insertions(+), 746 deletions(-) delete mode 100644 test/libtestutil.a diff --git a/test/bntest.c b/test/bntest.c index 0410e07d08..97ad97aca6 100644 --- a/test/bntest.c +++ b/test/bntest.c @@ -70,6 +70,12 @@ static const int NUM1 = 50; /* additional tests for some functions */ static FILE *fp; static BN_CTX *ctx; +/* + * Polynomial coefficients used in GFM tests. + */ +static int p0[] = { 163, 7, 6, 3, 0, -1 }; +static int p1[] = { 193, 15, 0, -1 }; + /* * Look for |key| in the stanza and return it or NULL if not found. @@ -106,13 +112,12 @@ static BIGNUM *getBN(STANZA *s, const char *attribute) BIGNUM *ret = NULL; if ((hex = findattr(s, attribute)) == NULL) { - fprintf(stderr, "Can't find %s in test at line %d\n", - attribute, s->start); + TEST_error("Can't find %s in test at line %d", attribute, s->start); return NULL; } if (parseBN(&ret, hex) != (int)strlen(hex)) { - fprintf(stderr, "Could not decode '%s'.\n", hex); + TEST_error("Could not decode '%s'", hex); return NULL; } return ret; @@ -120,14 +125,12 @@ static BIGNUM *getBN(STANZA *s, const char *attribute) static int getint(STANZA *s, int *out, const char *attribute) { - BIGNUM *ret = getBN(s, attribute); + BIGNUM *ret; BN_ULONG word; int st = 0; - if (ret == NULL) - goto err; - - if ((word = BN_get_word(ret)) > INT_MAX) + if (!TEST_ptr(ret = getBN(s, attribute)) + || !TEST_ulong_le(word = BN_get_word(ret), INT_MAX)) goto err; *out = (int)word; @@ -153,13 +156,10 @@ static int equalBN(const char *op, const BIGNUM *expected, const BIGNUM *actual) actstr = OPENSSL_strdup("-0"); else actstr = BN_bn2hex(actual); - if (exstr == NULL || actstr == NULL) + if (!TEST_ptr(exstr) || !TEST_ptr(actstr)) goto err; - fprintf(stderr, "Got %s =\n", op); - fprintf(stderr, "\t%s\n", actstr); - fprintf(stderr, "wanted:\n"); - fprintf(stderr, "\t%s\n", exstr); + TEST_error("Got %s =\n\t%s\nwanted:\n\t%s", op, actstr, exstr); err: OPENSSL_free(exstr); @@ -182,19 +182,20 @@ static int rand_neg(void) static int test_sub() { - BIGNUM *a, *b, *c; - int i; + BIGNUM *a = NULL, *b = NULL, *c = NULL; + int i, st = 0; - a = BN_new(); - b = BN_new(); - c = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(c = BN_new())) + goto err; for (i = 0; i < NUM0 + NUM1; i++) { if (i < NUM1) { BN_bntest_rand(a, 512, 0, 0); BN_copy(b, a); - if (BN_set_bit(a, i) == 0) - return 0; + if (!TEST_int_ne(BN_set_bit(a, i), 0)) + goto err; BN_add_word(b, i); } else { BN_bntest_rand(b, 400 + i - NUM1, 0, 0); @@ -204,30 +205,31 @@ static int test_sub() BN_sub(c, a, b); BN_add(c, c, b); BN_sub(c, c, a); - if (!BN_is_zero(c)) { - printf("Subtract test failed!\n"); - return 0; - } + if (!TEST_true(BN_is_zero(c))) + goto err; } + st = 1; +err: BN_free(a); BN_free(b); BN_free(c); - return 1; + return st; } static int test_div_recip() { - BIGNUM *a, *b, *c, *d, *e; - BN_RECP_CTX *recp; - int i; + BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL; + BN_RECP_CTX *recp = NULL; + int st = 0, i; - recp = BN_RECP_CTX_new(); - a = BN_new(); - b = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(recp = BN_RECP_CTX_new())) + goto err; for (i = 0; i < NUM0 + NUM1; i++) { if (i < NUM1) { @@ -244,36 +246,32 @@ static int test_div_recip() BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); - if (!BN_is_zero(d)) { - printf("Reciprocal division test failed!\n"); - printf("a="); - BN_print_fp(stdout, a); - printf("\nb="); - BN_print_fp(stdout, b); - printf("\n"); - return 0; - } + if (!TEST_true(BN_is_zero(d))) + goto err; } + st = 1; +err: BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); BN_RECP_CTX_free(recp); - return 1; + return st; } static int test_mod() { - BIGNUM *a, *b, *c, *d, *e; - int i; + BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL; + int st = 0, i; - a = BN_new(); - b = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new())) + goto err; BN_bntest_rand(a, 1024, 0, 0); for (i = 0; i < NUM0; i++) { @@ -283,17 +281,17 @@ static int test_mod() BN_mod(c, a, b, ctx); BN_div(d, e, a, b, ctx); BN_sub(e, e, c); - if (!BN_is_zero(e)) { - printf("Modulo test failed!\n"); - return 0; - } + if (!TEST_true(BN_is_zero(e))) + goto err; } + st = 1; +err: BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); - return 1; + return st; } static const char *bn1strings[] = { @@ -344,11 +342,10 @@ static char *glue(const char *list[]) for (i = 0; list[i] != NULL; i++) len += strlen(list[i]); - p = save = OPENSSL_malloc(len + 1); - if (p != NULL) { - for (i = 0; list[i] != NULL; i++) - p += strlen(strcpy(p, list[i])); - } + if (!TEST_ptr(p = save = OPENSSL_malloc(len + 1))) + return NULL; + for (i = 0; list[i] != NULL; i++) + p += strlen(strcpy(p, list[i])); return save; } @@ -358,30 +355,31 @@ static char *glue(const char *list[]) */ static int test_modexp_mont5() { - BIGNUM *a, *p, *m, *d, *e, *b, *n, *c; - BN_MONT_CTX *mont; + BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; + BIGNUM *b = NULL, *n = NULL, *c = NULL; + BN_MONT_CTX *mont = NULL; char *bigstring; + int st = 0; - a = BN_new(); - p = BN_new(); - m = BN_new(); - d = BN_new(); - e = BN_new(); - b = BN_new(); - n = BN_new(); - c = BN_new(); - mont = BN_MONT_CTX_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(p = BN_new()) + || !TEST_ptr(m = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(n = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(mont = BN_MONT_CTX_new())) + goto err; BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */ /* Zero exponent */ BN_bntest_rand(a, 1024, 0, 0); BN_zero(p); - if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) - return 0; - if (!BN_is_one(d)) { - printf("Modular exponentiation test failed!\n"); - return 0; - } + if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) + goto err; + if (!TEST_true(BN_is_one(d))) + goto err; /* Regression test for carry bug in mulx4x_mont */ BN_hex2bn(&a, @@ -402,11 +400,8 @@ static int test_modexp_mont5() BN_MONT_CTX_set(mont, n, ctx); BN_mod_mul_montgomery(c, a, b, mont, ctx); BN_mod_mul_montgomery(d, b, a, mont, ctx); - if (BN_cmp(c, d)) { - fprintf(stderr, "Montgomery multiplication test failed:" - " a*b != b*a.\n"); - return 0; - } + if (!TEST_int_eq(BN_cmp(c, d), 0)) + goto err; /* Regression test for carry bug in sqr[x]8x_mont */ bigstring = glue(bn1strings); @@ -420,21 +415,16 @@ static int test_modexp_mont5() BN_MONT_CTX_set(mont, n, ctx); BN_mod_mul_montgomery(c, a, a, mont, ctx); BN_mod_mul_montgomery(d, a, b, mont, ctx); - if (BN_cmp(c, d)) { - fprintf(stderr, "Montgomery multiplication test failed:" - " a**2 != a*a.\n"); - return 0; - } + if (!TEST_int_eq(BN_cmp(c, d), 0)) + goto err; /* Zero input */ BN_bntest_rand(p, 1024, 0, 0); BN_zero(a); - if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) - return 0; - if (!BN_is_zero(d)) { - fprintf(stderr, "Modular exponentiation test failed!\n"); - return 0; - } + if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) + || !TEST_true(BN_is_zero(d))) + goto err; + /* * Craft an input whose Montgomery representation is 1, i.e., shorter * than the modulus m, in order to test the const time precomputation @@ -442,26 +432,22 @@ static int test_modexp_mont5() */ BN_one(a); BN_MONT_CTX_set(mont, m, ctx); - if (!BN_from_montgomery(e, a, mont, ctx)) - return 0; - if (!BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) - return 0; - if (!BN_mod_exp_simple(a, e, p, m, ctx)) - return 0; - if (BN_cmp(a, d) != 0) { - printf("Modular exponentiation test failed!\n"); - return 0; - } + if (!TEST_true(BN_from_montgomery(e, a, mont, ctx)) + || !TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) + || !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx)) + || !TEST_int_eq(BN_cmp(a, d), 0)) + goto err; + /* Finally, some regular test vectors. */ BN_bntest_rand(e, 1024, 0, 0); - if (!BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) - return 0; - if (!BN_mod_exp_simple(a, e, p, m, ctx)) - return 0; - if (BN_cmp(a, d) != 0) { - printf("Modular exponentiation test failed!\n"); - return 0; - } + if (!TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) + || !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx)) + || !TEST_int_eq(BN_cmp(a, d), 0)) + goto err; + + st = 1; + +err: BN_MONT_CTX_free(mont); BN_free(a); BN_free(p); @@ -471,18 +457,19 @@ static int test_modexp_mont5() BN_free(b); BN_free(n); BN_free(c); - return 1; + return st; } #ifndef OPENSSL_NO_EC2M static int test_gf2m_add() { - BIGNUM *a, *b, *c; + BIGNUM *a = NULL, *b = NULL, *c = NULL; int i, st = 0; - a = BN_new(); - b = BN_new(); - c = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(c = BN_new())) + goto err; for (i = 0; i < NUM0; i++) { BN_rand(a, 512, 0, 0); @@ -491,17 +478,13 @@ static int test_gf2m_add() b->neg = rand_neg(); BN_GF2m_add(c, a, b); /* Test that two added values have the correct parity. */ - if ((BN_is_odd(a) && BN_is_odd(c)) - || (!BN_is_odd(a) && !BN_is_odd(c))) { - printf("GF(2^m) addition test (a) failed!\n"); + if (!TEST_false((BN_is_odd(a) && BN_is_odd(c)) + || (!BN_is_odd(a) && !BN_is_odd(c)))) goto err; - } BN_GF2m_add(c, c, c); /* Test that c + c = 0. */ - if (!BN_is_zero(c)) { - printf("GF(2^m) addition test (b) failed!\n"); + if (!TEST_true(BN_is_zero(c))) goto err; - } } st = 1; err: @@ -513,17 +496,16 @@ static int test_gf2m_add() static int test_gf2m_mod() { - static int p0[] = { 163, 7, 6, 3, 0, -1 }; - static int p1[] = { 193, 15, 0, -1 }; - BIGNUM *a, *b[2], *c, *d, *e; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL, *e = NULL; int i, j, st = 0; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -535,10 +517,8 @@ static int test_gf2m_mod() BN_GF2m_add(d, a, c); BN_GF2m_mod(e, d, b[j]); /* Test that a + (a mod p) mod p == 0. */ - if (!BN_is_zero(e)) { - printf("GF(2^m) modulo test failed!\n"); + if (!TEST_true(BN_is_zero(e))) goto err; - } } } st = 1; @@ -554,20 +534,20 @@ static int test_gf2m_mod() static int test_gf2m_mul() { - BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h; + BIGNUM *a, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL; + BIGNUM *e = NULL, *f = NULL, *g = NULL, *h = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); - f = BN_new(); - g = BN_new(); - h = BN_new(); + + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(f = BN_new()) + || !TEST_ptr(g = BN_new()) + || !TEST_ptr(h = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -584,13 +564,12 @@ static int test_gf2m_mul() BN_GF2m_add(f, e, g); BN_GF2m_add(f, f, h); /* Test that (a+d)*c = a*c + d*c. */ - if (!BN_is_zero(f)) { - printf("GF(2^m) modular multiplication test failed!\n"); + if (!TEST_true(BN_is_zero(f))) goto err; - } } } st = 1; + err: BN_free(a); BN_free(b[0]); @@ -606,16 +585,15 @@ static int test_gf2m_mul() static int test_gf2m_sqr() { - BIGNUM *a, *b[2], *c, *d; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -628,10 +606,8 @@ static int test_gf2m_sqr() BN_GF2m_mod_mul(d, a, d, b[j], ctx); BN_GF2m_add(d, c, d); /* Test that a*a = a^2. */ - if (!BN_is_zero(d)) { - printf("GF(2^m) modular squaring test failed!\n"); + if (!TEST_true(BN_is_zero(d))) goto err; - } } } st = 1; @@ -646,16 +622,15 @@ static int test_gf2m_sqr() static int test_gf2m_modinv() { - BIGNUM *a, *b[2], *c, *d; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -666,10 +641,8 @@ static int test_gf2m_modinv() BN_GF2m_mod_inv(c, a, b[j], ctx); BN_GF2m_mod_mul(d, a, c, b[j], ctx); /* Test that ((1/a)*a) = 1. */ - if (!BN_is_one(d)) { - printf("GF(2^m) modular inversion test failed!\n"); + if (!TEST_true(BN_is_one(d))) goto err; - } } } st = 1; @@ -684,18 +657,18 @@ static int test_gf2m_modinv() static int test_gf2m_moddiv() { - BIGNUM *a, *b[2], *c, *d, *e, *f; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; + BIGNUM *e = NULL, *f = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); - f = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(f = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -708,10 +681,8 @@ static int test_gf2m_moddiv() BN_GF2m_mod_mul(e, d, c, b[j], ctx); BN_GF2m_mod_div(f, a, e, b[j], ctx); /* Test that ((a/c)*c)/a = 1. */ - if (!BN_is_one(f)) { - printf("GF(2^m) modular division test failed!\n"); + if (!TEST_true(BN_is_one(f))) goto err; - } } } st = 1; @@ -728,18 +699,18 @@ static int test_gf2m_moddiv() static int test_gf2m_modexp() { - BIGNUM *a, *b[2], *c, *d, *e, *f; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; + BIGNUM *e = NULL, *f = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); - f = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(f = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -756,10 +727,8 @@ static int test_gf2m_modexp() BN_GF2m_mod_exp(f, a, f, b[j], ctx); BN_GF2m_add(f, e, f); /* Test that a^(c+d)=a^c*a^d. */ - if (!BN_is_zero(f)) { - printf("GF(2^m) modular exponentiation test failed!\n"); + if (!TEST_true(BN_is_zero(f))) goto err; - } } } st = 1; @@ -776,18 +745,18 @@ static int test_gf2m_modexp() static int test_gf2m_modsqrt() { - BIGNUM *a, *b[2], *c, *d, *e, *f; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; + BIGNUM *e = NULL, *f = NULL; int i, j, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); - f = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new()) + || !TEST_ptr(f = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -800,10 +769,8 @@ static int test_gf2m_modsqrt() BN_GF2m_mod_sqr(e, d, b[j], ctx); BN_GF2m_add(f, c, e); /* Test that d^2 = a, where d = sqrt(a). */ - if (!BN_is_zero(f)) { - printf("GF(2^m) modular square root test failed!\n"); + if (!TEST_true(BN_is_zero(f))) goto err; - } } } st = 1; @@ -820,17 +787,17 @@ static int test_gf2m_modsqrt() static int test_gf2m_modsolvequad() { - BIGNUM *a, *b[2], *c, *d, *e; + BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL; + BIGNUM *e = NULL; int i, j, s = 0, t, st = 0; - int p0[] = { 163, 7, 6, 3, 0, -1 }; - int p1[] = { 193, 15, 0, -1 }; - a = BN_new(); - b[0] = BN_new(); - b[1] = BN_new(); - c = BN_new(); - d = BN_new(); - e = BN_new(); + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b[0] = BN_new()) + || !TEST_ptr(b[1] = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new()) + || !TEST_ptr(e = BN_new())) + goto err; BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); @@ -848,18 +815,13 @@ static int test_gf2m_modsolvequad() /* * Test that solution of quadratic c satisfies c^2 + c = a. */ - if (!BN_is_zero(e)) { - printf("GF(2^m) modular solve quadratic test failed!\n"); + if (!TEST_true(BN_is_zero(e))) goto err; - } - } } } - if (s == 0) { - printf("All %i tests of GF(2^m) modular solve quadratic resulted in no roots;\n", - NUM0); - printf("this is very unlikely and probably indicates an error.\n"); + if (!TEST_int_ge(s, 0)) { + TEST_info("%d tests found no roots; probably an error", NUM0); goto err; } st = 1; @@ -876,16 +838,13 @@ static int test_gf2m_modsolvequad() static int test_kronecker() { - BIGNUM *a, *b, *r, *t; - int i; - int legendre, kronecker; - int st = 0; + BIGNUM *a = NULL, *b = NULL, *r = NULL, *t = NULL; + int i, legendre, kronecker, st = 0; - a = BN_new(); - b = BN_new(); - r = BN_new(); - t = BN_new(); - if (a == NULL || b == NULL || r == NULL || t == NULL) + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(r = BN_new()) + || !TEST_ptr(t = BN_new())) goto err; /* @@ -898,27 +857,27 @@ static int test_kronecker() * is prime but whether BN_kronecker works.) */ - if (!BN_generate_prime_ex(b, 512, 0, NULL, NULL, NULL)) + if (!TEST_true(BN_generate_prime_ex(b, 512, 0, NULL, NULL, NULL))) goto err; b->neg = rand_neg(); for (i = 0; i < NUM0; i++) { - if (!BN_bntest_rand(a, 512, 0, 0)) + if (!TEST_true(BN_bntest_rand(a, 512, 0, 0))) goto err; a->neg = rand_neg(); /* t := (|b|-1)/2 (note that b is odd) */ - if (!BN_copy(t, b)) + if (!TEST_true(BN_copy(t, b))) goto err; t->neg = 0; - if (!BN_sub_word(t, 1)) + if (!TEST_true(BN_sub_word(t, 1))) goto err; - if (!BN_rshift1(t, t)) + if (!TEST_true(BN_rshift1(t, t))) goto err; /* r := a^t mod b */ b->neg = 0; - if (!BN_mod_exp_recp(r, a, t, b, ctx)) + if (!TEST_true(BN_mod_exp_recp(r, a, t, b, ctx))) goto err; b->neg = 1; @@ -927,30 +886,23 @@ static int test_kronecker() else if (BN_is_zero(r)) legendre = 0; else { - if (!BN_add_word(r, 1)) + if (!TEST_true(BN_add_word(r, 1))) goto err; - if (0 != BN_ucmp(r, b)) { - printf("Legendre symbol computation failed\n"); + if (!TEST_int_eq(BN_ucmp(r, b), 0)) { + TEST_info("Legendre symbol computation failed"); goto err; } legendre = -1; } - kronecker = BN_kronecker(a, b, ctx); - if (kronecker < -1) + if (!TEST_int_ge(kronecker = BN_kronecker(a, b, ctx), -1)) goto err; /* we actually need BN_kronecker(a, |b|) */ if (a->neg && b->neg) kronecker = -kronecker; - if (legendre != kronecker) { - printf("legendre != kronecker; a = "); - BN_print_fp(stdout, a); - printf(", b = "); - BN_print_fp(stdout, b); - printf("\n"); + if (!TEST_int_eq(legendre, kronecker)) goto err; - } } st = 1; @@ -964,21 +916,21 @@ static int test_kronecker() static int file_sum(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *b = getBN(s, "B"); - BIGNUM *sum = getBN(s, "Sum"); - BIGNUM *ret = BN_new(); + BIGNUM *a = NULL, *b = NULL, *sum = NULL, *ret = NULL; BN_ULONG b_word; int st = 0; - if (a == NULL || b == NULL || sum == NULL || ret == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(b = getBN(s, "B")) + || !TEST_ptr(sum = getBN(s, "Sum")) + || !TEST_ptr(ret = BN_new())) goto err; - if (!BN_add(ret, a, b) + if (!TEST_true(BN_add(ret, a, b)) || !equalBN("A + B", sum, ret) - || !BN_sub(ret, sum, a) + || !TEST_true(BN_sub(ret, sum, a)) || !equalBN("Sum - A", b, ret) - || !BN_sub(ret, sum, b) + || !TEST_true(BN_sub(ret, sum, b)) || !equalBN("Sum - B", a, ret)) goto err; @@ -987,23 +939,23 @@ static int file_sum(STANZA *s) * or when |r| and |b| point to the same BIGNUM. * TODO: Test where all of |r|, |a|, and |b| point to the same BIGNUM. */ - if (!BN_copy(ret, a) - || !BN_add(ret, ret, b) + if (!TEST_true(BN_copy(ret, a)) + || !TEST_true(BN_add(ret, ret, b)) || !equalBN("A + B (r is a)", sum, ret) - || !BN_copy(ret, b) - || !BN_add(ret, a, ret) + || !TEST_true(BN_copy(ret, b)) + || !TEST_true(BN_add(ret, a, ret)) || !equalBN("A + B (r is b)", sum, ret) - || !BN_copy(ret, sum) - || !BN_sub(ret, ret, a) + || !TEST_true(BN_copy(ret, sum)) + || !TEST_true(BN_sub(ret, ret, a)) || !equalBN("Sum - A (r is a)", b, ret) - || !BN_copy(ret, a) - || !BN_sub(ret, sum, ret) + || !TEST_true(BN_copy(ret, a)) + || !TEST_true(BN_sub(ret, sum, ret)) || !equalBN("Sum - A (r is b)", b, ret) - || !BN_copy(ret, sum) - || !BN_sub(ret, ret, b) + || !TEST_true(BN_copy(ret, sum)) + || !TEST_true(BN_sub(ret, ret, b)) || !equalBN("Sum - B (r is a)", a, ret) - || !BN_copy(ret, b) - || !BN_sub(ret, sum, ret) + || !TEST_true(BN_copy(ret, b)) + || !TEST_true(BN_sub(ret, sum, ret)) || !equalBN("Sum - B (r is b)", a, ret)) goto err; @@ -1015,11 +967,11 @@ static int file_sum(STANZA *s) * TODO: test that. */ if (!BN_is_negative(a) && !BN_is_negative(b) && BN_cmp(a, b) >= 0) { - if (!BN_uadd(ret, a, b) + if (!TEST_true(BN_uadd(ret, a, b)) || !equalBN("A +u B", sum, ret) - || !BN_usub(ret, sum, a) + || !TEST_true(BN_usub(ret, sum, a)) || !equalBN("Sum -u A", b, ret) - || !BN_usub(ret, sum, b) + || !TEST_true(BN_usub(ret, sum, b)) || !equalBN("Sum -u B", a, ret)) goto err; /* @@ -1027,23 +979,23 @@ static int file_sum(STANZA *s) * BIGNUM, or when |r| and |b| point to the same BIGNUM. * TODO: Test where all of |r|, |a|, and |b| point to the same BIGNUM. */ - if (!BN_copy(ret, a) - || !BN_uadd(ret, ret, b) + if (!TEST_true(BN_copy(ret, a)) + || !TEST_true(BN_uadd(ret, ret, b)) || !equalBN("A +u B (r is a)", sum, ret) - || !BN_copy(ret, b) - || !BN_uadd(ret, a, ret) + || !TEST_true(BN_copy(ret, b)) + || !TEST_true(BN_uadd(ret, a, ret)) || !equalBN("A +u B (r is b)", sum, ret) - || !BN_copy(ret, sum) - || !BN_usub(ret, ret, a) + || !TEST_true(BN_copy(ret, sum)) + || !TEST_true(BN_usub(ret, ret, a)) || !equalBN("Sum -u A (r is a)", b, ret) - || !BN_copy(ret, a) - || !BN_usub(ret, sum, ret) + || !TEST_true(BN_copy(ret, a)) + || !TEST_true(BN_usub(ret, sum, ret)) || !equalBN("Sum -u A (r is b)", b, ret) - || !BN_copy(ret, sum) - || !BN_usub(ret, ret, b) + || !TEST_true(BN_copy(ret, sum)) + || !TEST_true(BN_usub(ret, ret, b)) || !equalBN("Sum -u B (r is a)", a, ret) - || !BN_copy(ret, b) - || !BN_usub(ret, sum, ret) + || !TEST_true(BN_copy(ret, b)) + || !TEST_true(BN_usub(ret, sum, ret)) || !equalBN("Sum -u B (r is b)", a, ret)) goto err; } @@ -1053,11 +1005,11 @@ static int file_sum(STANZA *s) */ b_word = BN_get_word(b); if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) { - if (!BN_copy(ret, a) - || !BN_add_word(ret, b_word) + if (!TEST_true(BN_copy(ret, a)) + || !TEST_true(BN_add_word(ret, b_word)) || !equalBN("A + B (word)", sum, ret) - || !BN_copy(ret, sum) - || !BN_sub_word(ret, b_word) + || !TEST_true(BN_copy(ret, sum)) + || !TEST_true(BN_sub_word(ret, b_word)) || !equalBN("Sum - B (word)", a, ret)) goto err; } @@ -1073,41 +1025,41 @@ err: static int file_lshift1(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *lshift1 = getBN(s, "LShift1"); - BIGNUM *zero = BN_new(); - BIGNUM *ret = BN_new(); - BIGNUM *two = BN_new(); - BIGNUM *remainder = BN_new(); + BIGNUM *a = NULL, *lshift1 = NULL, *zero = NULL, *ret = NULL; + BIGNUM *two = NULL, *remainder = NULL; int st = 0; - if (a == NULL || lshift1 == NULL || zero == NULL - || ret == NULL || two == NULL || remainder == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(lshift1 = getBN(s, "LShift1")) + || !TEST_ptr(zero = BN_new()) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(two = BN_new()) + || !TEST_ptr(remainder = BN_new())) goto err; BN_zero(zero); - if (!BN_set_word(two, 2) - || !BN_add(ret, a, a) + if (!TEST_true(BN_set_word(two, 2)) + || !TEST_true(BN_add(ret, a, a)) || !equalBN("A + A", lshift1, ret) - || !BN_mul(ret, a, two, ctx) + || !TEST_true(BN_mul(ret, a, two, ctx)) || !equalBN("A * 2", lshift1, ret) - || !BN_div(ret, remainder, lshift1, two, ctx) + || !TEST_true(BN_div(ret, remainder, lshift1, two, ctx)) || !equalBN("LShift1 / 2", a, ret) || !equalBN("LShift1 % 2", zero, remainder) - || !BN_lshift1(ret, a) + || !TEST_true(BN_lshift1(ret, a)) || !equalBN("A << 1", lshift1, ret) - || !BN_rshift1(ret, lshift1) + || !TEST_true(BN_rshift1(ret, lshift1)) || !equalBN("LShift >> 1", a, ret) - || !BN_rshift1(ret, lshift1) + || !TEST_true(BN_rshift1(ret, lshift1)) || !equalBN("LShift >> 1", a, ret)) goto err; /* Set the LSB to 1 and test rshift1 again. */ - if (!BN_set_bit(lshift1, 0) - || !BN_div(ret, NULL /* rem */ , lshift1, two, ctx) + if (!TEST_true(BN_set_bit(lshift1, 0)) + || !TEST_true(BN_div(ret, NULL /* rem */ , lshift1, two, ctx)) || !equalBN("(LShift1 | 1) / 2", a, ret) - || !BN_rshift1(ret, lshift1) + || !TEST_true(BN_rshift1(ret, lshift1)) || !equalBN("(LShift | 1) >> 1", a, ret)) goto err; @@ -1125,18 +1077,16 @@ err: static int file_lshift(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *lshift = getBN(s, "LShift"); - BIGNUM *ret = BN_new(); - int n = 0; - int st = 0; + BIGNUM *a = NULL, *lshift = NULL, *ret = NULL; + int n = 0, st = 0; - if (a == NULL || lshift == NULL || ret == NULL || !getint(s, &n, "N")) - goto err; + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(lshift = getBN(s, "LShift")) + || !TEST_ptr(ret = BN_new())) - if (!BN_lshift(ret, a, n) + if (!TEST_true(BN_lshift(ret, a, n)) || !equalBN("A << N", lshift, ret) - || !BN_rshift(ret, lshift, n) + || !TEST_true(BN_rshift(ret, lshift, n)) || !equalBN("A >> N", a, ret)) goto err; @@ -1150,85 +1100,78 @@ err: static int file_rshift(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *rshift = getBN(s, "RShift"); - BIGNUM *ret = BN_new(); - int n = 0; - int errcnt = 1; + BIGNUM *a = NULL, *rshift = NULL, *ret = NULL; + int n = 0, st = 0; - if (a == NULL || rshift == NULL || ret == NULL || !getint(s, &n, "N")) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(rshift = getBN(s, "RShift")) + || !TEST_ptr(ret = BN_new()) + || !getint(s, &n, "N")) goto err; - errcnt = 0; - if (!BN_rshift(ret, a, n) + if (!TEST_true(BN_rshift(ret, a, n)) || !equalBN("A >> N", rshift, ret)) - errcnt++; + goto err; /* If N == 1, try with rshift1 as well */ if (n == 1) { - if (!BN_rshift1(ret, a) + if (!TEST_true(BN_rshift1(ret, a)) || !equalBN("A >> 1 (rshift1)", rshift, ret)) - errcnt++; + goto err; } + st = 1; err: BN_free(a); BN_free(rshift); BN_free(ret); - return errcnt == 0; + return st; } static int file_square(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *square = getBN(s, "Square"); - BIGNUM *zero = BN_new(); - BIGNUM *ret = BN_new(); - BIGNUM *remainder = BN_new(); - BIGNUM *tmp = NULL; + BIGNUM *a = NULL, *square = NULL, *zero = NULL, *ret = NULL; + BIGNUM *remainder = NULL, *tmp = NULL; int st = 0; - if (a == NULL || square == NULL || zero == NULL || ret == NULL - || remainder == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(square = getBN(s, "Square")) + || !TEST_ptr(zero = BN_new()) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(remainder = BN_new())) goto err; BN_zero(zero); - - if (!BN_sqr(ret, a, ctx) + if (!TEST_true(BN_sqr(ret, a, ctx)) || !equalBN("A^2", square, ret) - || !BN_mul(ret, a, a, ctx) + || !TEST_true(BN_mul(ret, a, a, ctx)) || !equalBN("A * A", square, ret) - || !BN_div(ret, remainder, square, a, ctx) + || !TEST_true(BN_div(ret, remainder, square, a, ctx)) || !equalBN("Square / A", a, ret) || !equalBN("Square % A", zero, remainder)) goto err; #if HAVE_BN_SQRT BN_set_negative(a, 0); - if (!BN_sqrt(ret, square, ctx) + if (!TEST_true(BN_sqrt(ret, square, ctx)) || !equalBN("sqrt(Square)", a, ret)) goto err; /* BN_sqrt should fail on non-squares and negative numbers. */ - if (!BN_is_zero(square)) { - tmp = BN_new(); - if (tmp == NULL || !BN_copy(tmp, square)) + if (!TEST_true(BN_is_zero(square))) { + if (!TEST_ptr(tmp = BN_new()) || !TEST_true(BN_copy(tmp, square))) goto err; BN_set_negative(tmp, 1); - if (BN_sqrt(ret, tmp, ctx)) { - fprintf(stderr, "BN_sqrt succeeded on a negative number"); + if (!TEST_int_eq(BN_sqrt(ret, tmp, ctx), 0)) goto err; - } ERR_clear_error(); BN_set_negative(tmp, 0); if (BN_add(tmp, tmp, BN_value_one())) goto err; - if (BN_sqrt(ret, tmp, ctx)) { - fprintf(stderr, "BN_sqrt succeeded on a non-square"); + if (!TEST_int_eq(BN_sqrt(ret, tmp, ctx))) goto err; - } ERR_clear_error(); } #endif @@ -1246,26 +1189,26 @@ err: static int file_product(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *b = getBN(s, "B"); - BIGNUM *product = getBN(s, "Product"); - BIGNUM *ret = BN_new(); - BIGNUM *remainder = BN_new(); - BIGNUM *zero = BN_new(); + BIGNUM *a = NULL, *b = NULL, *product = NULL, *ret = NULL; + BIGNUM *remainder = NULL, *zero = NULL; int st = 0; - if (a == NULL || b == NULL || product == NULL || ret == NULL - || remainder == NULL || zero == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(b = getBN(s, "B")) + || !TEST_ptr(product = getBN(s, "Product")) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(remainder = BN_new()) + || !TEST_ptr(zero = BN_new())) goto err; BN_zero(zero); - if (!BN_mul(ret, a, b, ctx) + if (!TEST_true(BN_mul(ret, a, b, ctx)) || !equalBN("A * B", product, ret) - || !BN_div(ret, remainder, product, a, ctx) + || !TEST_true(BN_div(ret, remainder, product, a, ctx)) || !equalBN("Product / A", b, ret) || !equalBN("Product % A", zero, remainder) - || !BN_div(ret, remainder, product, b, ctx) + || !TEST_true(BN_div(ret, remainder, product, b, ctx)) || !equalBN("Product / B", a, ret) || !equalBN("Product % B", zero, remainder)) goto err; @@ -1283,25 +1226,25 @@ err: static int file_quotient(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *b = getBN(s, "B"); - BIGNUM *quotient = getBN(s, "Quotient"); - BIGNUM *remainder = getBN(s, "Remainder"); - BIGNUM *ret = BN_new(); - BIGNUM *ret2 = BN_new(); - BIGNUM *nnmod = BN_new(); + BIGNUM *a = NULL, *b = NULL, *quotient = NULL, *remainder = NULL; + BIGNUM *ret = NULL, *ret2 = NULL, *nnmod = NULL; BN_ULONG b_word, ret_word; int st = 0; - if (a == NULL || b == NULL || quotient == NULL || remainder == NULL - || ret == NULL || ret2 == NULL || nnmod == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(b = getBN(s, "B")) + || !TEST_ptr(quotient = getBN(s, "Quotient")) + || !TEST_ptr(remainder = getBN(s, "Remainder")) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(ret2 = BN_new()) + || !TEST_ptr(nnmod = BN_new())) goto err; - if (!BN_div(ret, ret2, a, b, ctx) + if (!TEST_true(BN_div(ret, ret2, a, b, ctx)) || !equalBN("A / B", quotient, ret) || !equalBN("A % B", remainder, ret2) - || !BN_mul(ret, quotient, b, ctx) - || !BN_add(ret, ret, remainder) + || !TEST_true(BN_mul(ret, quotient, b, ctx)) + || !TEST_true(BN_add(ret, ret, remainder)) || !equalBN("Quotient * B + Remainder", a, ret)) goto err; @@ -1314,16 +1257,16 @@ static int file_quotient(STANZA *s) BN_ULONG remainder_word = BN_get_word(remainder); assert(remainder_word != (BN_ULONG)-1); - if (!BN_copy(ret, a)) + if (!TEST_ptr(BN_copy(ret, a))) goto err; ret_word = BN_div_word(ret, b_word); if (ret_word != remainder_word) { #ifdef BN_DEC_FMT1 - fprintf(stderr, - "Got A %% B (word) = " BN_DEC_FMT1 ", wanted " BN_DEC_FMT1 "\n", + TEST_error( + "Got A %% B (word) = " BN_DEC_FMT1 ", wanted " BN_DEC_FMT1, ret_word, remainder_word); #else - fprintf(stderr, "Got A %% B (word) mismatch\n"); + TEST_error("Got A %% B (word) mismatch"); #endif goto err; } @@ -1333,11 +1276,11 @@ static int file_quotient(STANZA *s) ret_word = BN_mod_word(a, b_word); if (ret_word != remainder_word) { #ifdef BN_DEC_FMT1 - fprintf(stderr, - "Got A %% B (word) = " BN_DEC_FMT1 ", wanted " BN_DEC_FMT1 "\n", + TEST_error( + "Got A %% B (word) = " BN_DEC_FMT1 ", wanted " BN_DEC_FMT1 "", ret_word, remainder_word); #else - fprintf(stderr, "Got A %% B (word) mismatch\n"); + TEST_error("Got A %% B (word) mismatch"); #endif goto err; } @@ -1345,9 +1288,10 @@ static int file_quotient(STANZA *s) /* Test BN_nnmod. */ if (!BN_is_negative(b)) { - if (!BN_copy(nnmod, remainder) - || (BN_is_negative(nnmod) && !BN_add(nnmod, nnmod, b)) - || !BN_nnmod(ret, a, b, ctx) + if (!TEST_true(BN_copy(nnmod, remainder)) + || (BN_is_negative(nnmod) + && !TEST_true(BN_add(nnmod, nnmod, b))) + || !TEST_true(BN_nnmod(ret, a, b, ctx)) || !equalBN("A % B (non-negative)", nnmod, ret)) goto err; } @@ -1366,17 +1310,17 @@ err: static int file_modmul(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *b = getBN(s, "B"); - BIGNUM *m = getBN(s, "M"); - BIGNUM *mod_mul = getBN(s, "ModMul"); - BIGNUM *ret = BN_new(); + BIGNUM *a = NULL, *b = NULL, *m = NULL, *mod_mul = NULL, *ret = NULL; int st = 0; - if (a == NULL || b == NULL || m == NULL || mod_mul == NULL || ret == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(b = getBN(s, "B")) + || !TEST_ptr(m = getBN(s, "M")) + || !TEST_ptr(mod_mul = getBN(s, "ModMul")) + || !TEST_ptr(ret = BN_new())) goto err; - if (!BN_mod_mul(ret, a, b, m, ctx) + if (!TEST_true(BN_mod_mul(ret, a, b, m, ctx)) || !equalBN("A * B (mod M)", mod_mul, ret)) goto err; @@ -1385,19 +1329,20 @@ static int file_modmul(STANZA *s) BN_MONT_CTX *mont = BN_MONT_CTX_new(); BIGNUM *a_tmp = BN_new(); BIGNUM *b_tmp = BN_new(); + if (mont == NULL || a_tmp == NULL || b_tmp == NULL - || !BN_MONT_CTX_set(mont, m, ctx) - || !BN_nnmod(a_tmp, a, m, ctx) - || !BN_nnmod(b_tmp, b, m, ctx) - || !BN_to_montgomery(a_tmp, a_tmp, mont, ctx) - || !BN_to_montgomery(b_tmp, b_tmp, mont, ctx) - || !BN_mod_mul_montgomery(ret, a_tmp, b_tmp, mont, ctx) - || !BN_from_montgomery(ret, ret, mont, ctx) - || !equalBN("A * B (mod M) (mont)", mod_mul, ret)) { + || !TEST_true(BN_MONT_CTX_set(mont, m, ctx)) + || !TEST_true(BN_nnmod(a_tmp, a, m, ctx)) + || !TEST_true(BN_nnmod(b_tmp, b, m, ctx)) + || !TEST_true(BN_to_montgomery(a_tmp, a_tmp, mont, ctx)) + || !TEST_true(BN_to_montgomery(b_tmp, b_tmp, mont, ctx)) + || !TEST_true(BN_mod_mul_montgomery(ret, a_tmp, b_tmp, + mont, ctx)) + || !TEST_true(BN_from_montgomery(ret, ret, mont, ctx)) + || !equalBN("A * B (mod M) (mont)", mod_mul, ret)) st = 0; - } else { + else st = 1; - } BN_MONT_CTX_free(mont); BN_free(a_tmp); BN_free(b_tmp); @@ -1417,25 +1362,27 @@ err: static int file_modexp(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *e = getBN(s, "E"); - BIGNUM *m = getBN(s, "M"); - BIGNUM *mod_exp = getBN(s, "ModExp"); - BIGNUM *ret = BN_new(); - BIGNUM *b = NULL, *c = NULL, *d = BN_new(); + BIGNUM *a = NULL, *e = NULL, *m = NULL, *mod_exp = NULL, *ret = NULL; + BIGNUM *b = NULL, *c = NULL, *d = NULL; int st = 0; - if (a == NULL || e == NULL || m == NULL || mod_exp == NULL || ret == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(e = getBN(s, "E")) + || !TEST_ptr(m = getBN(s, "M")) + || !TEST_ptr(mod_exp = getBN(s, "ModExp")) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(d = BN_new())) goto err; - if (!BN_mod_exp(ret, a, e, m, ctx) + if (!TEST_true(BN_mod_exp(ret, a, e, m, ctx)) || !equalBN("A ^ E (mod M)", mod_exp, ret)) goto err; if (BN_is_odd(m)) { - if (!BN_mod_exp_mont(ret, a, e, m, ctx, NULL) + if (!TEST_true(BN_mod_exp_mont(ret, a, e, m, ctx, NULL)) || !equalBN("A ^ E (mod M) (mont)", mod_exp, ret) - || !BN_mod_exp_mont_consttime(ret, a, e, m, ctx, NULL) + || !TEST_true(BN_mod_exp_mont_consttime(ret, a, e, m, + ctx, NULL)) || !equalBN("A ^ E (mod M) (mont const", mod_exp, ret)) goto err; } @@ -1452,10 +1399,8 @@ static int file_modexp(STANZA *s) "0000000000000000000000000000000000000000000000000000000001"); BN_mod_exp(d, a, b, c, ctx); BN_mul(e, a, a, ctx); - if (BN_cmp(d, e)) { - fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n"); + if (!TEST_int_eq(BN_cmp(d, e), 0)) goto err; - } st = 1; err: @@ -1472,16 +1417,16 @@ err: static int file_exp(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *e = getBN(s, "E"); - BIGNUM *exp = getBN(s, "Exp"); - BIGNUM *ret = BN_new(); + BIGNUM *a = NULL, *e = NULL, *exp = NULL, *ret = NULL; int st = 0; - if (a == NULL || e == NULL || exp == NULL || ret == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(e = getBN(s, "E")) + || !TEST_ptr(exp = getBN(s, "Exp")) + || !TEST_ptr(ret = BN_new())) goto err; - if (!BN_exp(ret, a, e, ctx) + if (!TEST_true(BN_exp(ret, a, e, ctx)) || !equalBN("A ^ E", exp, ret)) goto err; @@ -1496,21 +1441,22 @@ err: static int file_modsqrt(STANZA *s) { - BIGNUM *a = getBN(s, "A"); - BIGNUM *p = getBN(s, "P"); - BIGNUM *mod_sqrt = getBN(s, "ModSqrt"); - BIGNUM *ret = BN_new(); - BIGNUM *ret2 = BN_new(); + BIGNUM *a = NULL, *p = NULL, *mod_sqrt = NULL, *ret = NULL, *ret2 = NULL; int st = 0; - if (a == NULL || p == NULL || mod_sqrt == NULL - || ret == NULL || ret2 == NULL) + if (!TEST_ptr(a = getBN(s, "A")) + || !TEST_ptr(p = getBN(s, "P")) + || !TEST_ptr(mod_sqrt = getBN(s, "ModSqrt")) + || !TEST_ptr(ret = BN_new()) + || !TEST_ptr(ret2 = BN_new())) goto err; /* There are two possible answers. */ - if (!BN_mod_sqrt(ret, a, p, ctx) || !BN_sub(ret2, p, ret)) + if (!TEST_true(BN_mod_sqrt(ret, a, p, ctx)) + || !TEST_true(BN_sub(ret2, p, ret))) goto err; + /* The first condition should NOT be a test. */ if (BN_cmp(ret2, mod_sqrt) != 0 && !equalBN("sqrt(A) (mod P)", mod_sqrt, ret)) goto err; @@ -1535,71 +1481,46 @@ static int test_bn2padded() /* Test edge case at 0. */ if (n == NULL) goto err; - if (!BN_bn2bin_padded(NULL, 0, n)) { - fprintf(stderr, - "BN_bn2bin_padded failed to encode 0 in an empty buffer.\n"); + if (!TEST_true(BN_bn2bin_padded(NULL, 0, n))) goto err; - } memset(out, -1, sizeof(out)); - if (!BN_bn2bin_padded(out, sizeof(out), n)) { - fprintf(stderr, - "BN_bn2bin_padded failed to encode 0 in a non-empty buffer.\n"); + if (!TEST_true(BN_bn2bin_padded(out, sizeof(out)), n)) goto err; - } memset(zeros, 0, sizeof(zeros)); - if (memcmp(zeros, out, sizeof(out))) { - fprintf(stderr, "BN_bn2bin_padded did not zero buffer.\n"); + if (!TEST_mem_eq(zeros, sizeof(zeros), out, sizeof(out))) goto err; - } /* Test a random numbers at various byte lengths. */ for (size_t bytes = 128 - 7; bytes <= 128; bytes++) { #define TOP_BIT_ON 0 #define BOTTOM_BIT_NOTOUCH 0 - if (!BN_rand(n, bytes * 8, TOP_BIT_ON, BOTTOM_BIT_NOTOUCH)) { - ERR_print_errors_fp(stderr); + if (!TEST_true(BN_rand(n, bytes * 8, TOP_BIT_ON, BOTTOM_BIT_NOTOUCH))) goto err; - } - if (BN_num_bytes(n) != bytes - || BN_bn2bin(n, reference) != bytes) { - fprintf(stderr, "Bad result from BN_rand; bytes.\n"); + if (!TEST_int_eq(BN_num_bytes(n),A) bytes + || TEST_int_eq(BN_bn2bin(n, reference), bytes)) goto err; - } /* Empty buffer should fail. */ - if (BN_bn2bin_padded(NULL, 0, n)) { - fprintf(stderr, - "BN_bn2bin_padded incorrectly succeeded on empty buffer.\n"); + if (!TEST_int_eq(BN_bn2bin_padded(NULL, 0, n)), 0) goto err; - } /* One byte short should fail. */ - if (BN_bn2bin_padded(out, bytes - 1, n)) { - fprintf(stderr, - "BN_bn2bin_padded incorrectly succeeded on short.\n"); + if (BN_bn2bin_padded(out, bytes - 1, n)) goto err; - } /* Exactly right size should encode. */ - if (!BN_bn2bin_padded(out, bytes, n) - || memcmp(out, reference, bytes) != 0) { - fprintf(stderr, - "BN_bn2bin_padded gave a bad result.\n"); + if (!TEST_true(BN_bn2bin_padded(out, bytes, n)) + || TEST_mem_eq(out, bytes, reference, bytes)) goto err; - } /* Pad up one byte extra. */ - if (!BN_bn2bin_padded(out, bytes + 1, n) - || memcmp(out + 1, reference, bytes) - || memcmp(out, zeros, 1)) { - fprintf(stderr, - "BN_bn2bin_padded gave a bad result.\n"); + if (!TEST_true(BN_bn2bin_padded(out, bytes + 1, n)) + || !TEST_mem_eq(out + 1, bytes, reference, bytes) + || !TEST_mem_eq(out, 1, zeros, 1)) goto err; - } /* Pad up to 256. */ - if (!BN_bn2bin_padded(out, sizeof(out), n) - || memcmp(out + sizeof(out) - bytes, reference, bytes) - || memcmp(out, zeros, sizeof(out) - bytes)) { - fprintf(stderr, - "BN_bn2bin_padded gave a bad result.\n"); + if (!TEST_true(BN_bn2bin_padded(out, sizeof(out)), n) + || !TEST_mem_eq(out + sizeof(out) - bytes, bytes, + reference, bytes) + || !TEST_mem_eq(out, sizseof(out) - bytes, + zeros, sizeof(out) - bytes)) goto err; - } } st = 1; @@ -1616,40 +1537,34 @@ static int test_dec2bn() BIGNUM *bn = NULL; int st = 0; - int ret = parsedecBN(&bn, "0"); - if (ret != 1 || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_dec2bn(0) gave a bad result.\n"); + if (!TEST_int_eq(parsedecBN(&bn, "0"), 1) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parsedecBN(&bn, "256"); - if (ret != 3 || !BN_is_word(bn, 256) || BN_is_negative(bn)) { - fprintf(stderr, "BN_dec2bn(256) gave a bad result.\n"); + if (!TEST_int_eq(parsedecBN(&bn, "256"), 3) + || !TEST_true(BN_is_word(bn, 256)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parsedecBN(&bn, "-42"); - if (ret != 3 || !BN_abs_is_word(bn, 42) || !BN_is_negative(bn)) { - fprintf(stderr, "BN_dec2bn(42) gave a bad result.\n"); + if (!TEST_int_eq(parsedecBN(&bn, "-42"), 3) + || !TEST_true(BN_abs_is_word(bn, 42)) + || !TEST_true(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parsedecBN(&bn, "-0"); - if (ret != 2 || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_dec2bn(-0) gave a bad result.\n"); + if (!TEST_int_eq(parsedecBN(&bn, "-0"), 2) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parsedecBN(&bn, "42trailing garbage is ignored"); - if (ret != 2 || !BN_abs_is_word(bn, 42) - || BN_is_negative(bn)) { - fprintf(stderr, "BN_dec2bn(42trailing...) gave a bad result.\n"); + if (!TEST_int_eq(parsedecBN(&bn, "42trailing garbage is ignored"), 2) + || !TEST_true(BN_abs_is_word(bn, 42)) + || !TEST_false(BN_is_negative(bn))) goto err; - } st = 1; err: @@ -1660,41 +1575,36 @@ err: static int test_hex2bn() { BIGNUM *bn = NULL; - int ret, st = 0; + int st = 0; - ret = parseBN(&bn, "0"); - if (ret != 1 || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_hex2bn(0) gave a bad result.\n"); + if (!TEST_int_eq(parseBN(&bn, "0"), 1) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parseBN(&bn, "256"); - if (ret != 3 || !BN_is_word(bn, 0x256) || BN_is_negative(bn)) { - fprintf(stderr, "BN_hex2bn(256) gave a bad result.\n"); + if (!TEST_int_eq(parseBN(&bn, "256"), 3) + || !TEST_true(BN_is_word(bn, 0x256)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parseBN(&bn, "-42"); - if (ret != 3 || !BN_abs_is_word(bn, 0x42) || !BN_is_negative(bn)) { - fprintf(stderr, "BN_hex2bn(-42) gave a bad result.\n"); + if (!TEST_int_eq(parseBN(&bn, "-42"), 3) + || !TEST_true(BN_abs_is_word(bn, 0x42)) + || !TEST_true(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parseBN(&bn, "-0"); - if (ret != 2 || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_hex2bn(-0) gave a bad result.\n"); + if (!TEST_int_eq(parseBN(&bn, "-0"), 2) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) goto err; - } BN_free(bn); - ret = parseBN(&bn, "abctrailing garbage is ignored"); - if (ret != 3 || !BN_is_word(bn, 0xabc) || BN_is_negative(bn)) { - fprintf(stderr, "BN_hex2bn(abctrail...) gave a bad result.\n"); + if (!TEST_int_eq(parseBN(&bn, "abctrailing garbage is ignored"), 3) + || !TEST_true(BN_is_word(bn, 0xabc)) + || !TEST_false(BN_is_negative(bn))) goto err; - } st = 1; err: @@ -1704,53 +1614,51 @@ err: static int test_asc2bn() { - BIGNUM *bn = BN_new(); + BIGNUM *bn = NULL; int st = 0; - if (!BN_asc2bn(&bn, "0") || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(0) gave a bad result.\n"); + if (!TEST_ptr(bn = BN_new())) goto err; - } - if (!BN_asc2bn(&bn, "256") || !BN_is_word(bn, 256) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(256) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "0")) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "-42") - || !BN_abs_is_word(bn, 42) || !BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(-42) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "256")) + || !TEST_true(BN_is_word(bn, 256)) + || !TEST_false(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "0x1234") - || !BN_is_word(bn, 0x1234) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(0x1234) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "-42")) + || !TEST_true(BN_abs_is_word(bn, 42)) + || !TEST_true(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "0X1234") - || !BN_is_word(bn, 0x1234) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(0X1234) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "0x1234")) + || !TEST_true(BN_is_word(bn, 0x1234)) + || !TEST_false(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "-0xabcd") - || !BN_abs_is_word(bn, 0xabcd) || !BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(-0xabcd) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "0X1234")) + || !TEST_true(BN_is_word(bn, 0x1234)) + || !TEST_false(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "-0") || !BN_is_zero(bn) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(-0) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "-0xabcd")) + || !TEST_true(BN_abs_is_word(bn, 0xabcd)) + || !TEST_true(BN_is_negative(bn))) goto err; - } - if (!BN_asc2bn(&bn, "123trailing garbage is ignored") - || !BN_is_word(bn, 123) || BN_is_negative(bn)) { - fprintf(stderr, "BN_asc2bn(123trail...) gave a bad result.\n"); + if (!TEST_true(BN_asc2bn(&bn, "-0")) + || !TEST_true(BN_is_zero(bn)) + || !TEST_false(BN_is_negative(bn))) + goto err; + + if (!TEST_true(BN_asc2bn(&bn, "123trailing garbage is ignored")) + || !TEST_true(BN_is_word(bn, 123)) + || !TEST_false(BN_is_negative(bn))) goto err; - } st = 1; err: @@ -1767,57 +1675,34 @@ static const MPITEST kMPITests[] = { {"-256", "\x00\x00\x00\x02\x81\x00", 6}, }; -static int test_mpi() +static int test_mpi(int i) { uint8_t scratch[8]; - int i = (int)sizeof(kMPITests) / sizeof(kMPITests[0]); - const MPITEST *test = kMPITests; + const MPITEST *test = &kMPITests[i]; size_t mpi_len, mpi_len2; - BIGNUM *bn = BN_new(); + BIGNUM *bn = NULL; BIGNUM *bn2 = NULL; int st = 0; - for ( ; --i >= 0; test++) { - if (!BN_asc2bn(&bn, test->base10)) { - fprintf(stderr, "Can't convert %s\n", test->base10); - goto err; - } - mpi_len = BN_bn2mpi(bn, NULL); - if (mpi_len > sizeof (scratch)) { - fprintf(stderr, - "MPI test #%u: MPI size is too large to test.\n", - (unsigned)i); - goto err; - } - - mpi_len2 = BN_bn2mpi(bn, scratch); - if (mpi_len != mpi_len2) { - fprintf(stderr, "MPI test #%u: length changes.\n", - (unsigned)i); - goto err; - } + if (!TEST_ptr(bn = BN_new()) + || !TEST_true(BN_asc2bn(&bn, test->base10))) + goto err; + mpi_len = BN_bn2mpi(bn, NULL); + if (!TEST_size_t_le(mpi_len, sizeof(scratch))) + goto err; - if (mpi_len != test->mpi_len - || memcmp(test->mpi, scratch, mpi_len) != 0) { - fprintf(stderr, "MPI test #%u failed:\n", (unsigned)i); - goto err; - } + if (!TEST_size_t_eq(mpi_len2 = BN_bn2mpi(bn, scratch), mpi_len) + || !TEST_mem_eq(test->mpi, test->mpi_len, scratch, mpi_len)) + goto err; - bn2 = BN_mpi2bn(scratch, mpi_len, NULL); - if (bn2 == NULL) { - fprintf(stderr, "MPI test #%u: failed to parse\n", - (unsigned)i); - goto err; - } + if (!TEST_ptr(bn2 = BN_mpi2bn(scratch, mpi_len, NULL))) + goto err; - if (BN_cmp(bn, bn2) != 0) { - fprintf(stderr, "MPI test #%u: wrong result\n", - (unsigned)i); - BN_free(bn2); - goto err; - } + if (!TEST_int_eq(BN_cmp(bn, bn2), 0)) { BN_free(bn2); + goto err; } + BN_free(bn2); st = 1; err: @@ -1827,41 +1712,23 @@ err: static int test_rand() { - BIGNUM *bn = BN_new(); + BIGNUM *bn = NULL; int st = 0; - if (bn == NULL) + if (!TEST_ptr(bn = BN_new())) return 0; - /* - * Test BN_rand for degenerate cases with |top| and |bottom| parameters. - */ - if (BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ )) { - fprintf(stderr, "BN_rand1 gave a bad result.\n"); - goto err; - } - if (BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ )) { - fprintf(stderr, "BN_rand2 gave a bad result.\n"); - goto err; - } - - if (!BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ ) || !BN_is_word(bn, 1)) { - fprintf(stderr, "BN_rand3 gave a bad result.\n"); - goto err; - } - if (BN_rand(bn, 1, 1 /* top */ , 0 /* bottom */ )) { - fprintf(stderr, "BN_rand4 gave a bad result.\n"); - goto err; - } - if (!BN_rand(bn, 1, -1 /* top */ , 1 /* bottom */ ) || !BN_is_word(bn, 1)) { - fprintf(stderr, "BN_rand5 gave a bad result.\n"); - goto err; - } - - if (!BN_rand(bn, 2, 1 /* top */ , 0 /* bottom */ ) || !BN_is_word(bn, 3)) { - fprintf(stderr, "BN_rand6 gave a bad result.\n"); + /* Test BN_rand for degenerate cases with |top| and |bottom| parameters. */ + if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ )) + || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ )) + || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ )) + || !TEST_true(BN_is_word(bn, 1)) + || !TEST_false(BN_rand(bn, 1, 1 /* top */ , 0 /* bottom */ )) + || !TEST_true(BN_rand(bn, 1, -1 /* top */ , 1 /* bottom */ )) + || !TEST_true(BN_is_word(bn, 1)) + || !TEST_true(BN_rand(bn, 2, 1 /* top */ , 0 /* bottom */ )) + || !TEST_true(BN_is_word(bn, 3))) goto err; - } st = 1; err: @@ -1871,59 +1738,51 @@ err: static int test_negzero() { - BIGNUM *a = BN_new(); - BIGNUM *b = BN_new(); - BIGNUM *c = BN_new(); - BIGNUM *d = BN_new(); + BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL; BIGNUM *numerator = NULL, *denominator = NULL; int consttime, st = 0; - if (a == NULL || b == NULL || c == NULL || d == NULL) + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(c = BN_new()) + || !TEST_ptr(d = BN_new())) goto err; /* Test that BN_mul never gives negative zero. */ - if (!BN_set_word(a, 1)) + if (!TEST_true(BN_set_word(a, 1))) goto err; BN_set_negative(a, 1); BN_zero(b); - if (!BN_mul(c, a, b, ctx)) + if (!TEST_true(BN_mul(c, a, b, ctx))) goto err; - if (!BN_is_zero(c) || BN_is_negative(c)) { - fprintf(stderr, "Multiplication test failed!\n"); + if (!TEST_true(BN_is_zero(c)) + || !TEST_false(BN_is_negative(c))) goto err; - } for (consttime = 0; consttime < 2; consttime++) { - numerator = BN_new(); - denominator = BN_new(); - if (numerator == NULL || denominator == NULL) + if (!TEST_ptr(numerator = BN_new()) + || !TEST_ptr(denominator = BN_new())) goto err; if (consttime) { BN_set_flags(numerator, BN_FLG_CONSTTIME); BN_set_flags(denominator, BN_FLG_CONSTTIME); } /* Test that BN_div never gives negative zero in the quotient. */ - if (!BN_set_word(numerator, 1) || !BN_set_word(denominator, 2)) + if (!TEST_true(BN_set_word(numerator, 1)) + || !TEST_true(BN_set_word(denominator, 2))) goto err; BN_set_negative(numerator, 1); - if (!BN_div(a, b, numerator, denominator, ctx)) - goto err; - if (!BN_is_zero(a) || BN_is_negative(a)) { - fprintf(stderr, "Incorrect quotient (consttime = %d).\n", - consttime); + if (!TEST_true(BN_div(a, b, numerator, denominator, ctx)) + || !TEST_true(BN_is_zero(a)) + || !TEST_false(BN_is_negative(a))) goto err; - } /* Test that BN_div never gives negative zero in the remainder. */ - if (!BN_set_word(denominator, 1)) + if (!TEST_true(BN_set_word(denominator, 1)) + || !TEST_true(BN_div(a, b, numerator, denominator, ctx)) + || !TEST_true(BN_is_zero(b)) + || !TEST_false(BN_is_negative(b))) goto err; - if (!BN_div(a, b, numerator, denominator, ctx)) - goto err; - if (!BN_is_zero(b) || BN_is_negative(b)) { - fprintf(stderr, "Incorrect remainder (consttime = %d).\n", - consttime); - goto err; - } BN_free(numerator); BN_free(denominator); numerator = denominator = NULL; @@ -1932,12 +1791,10 @@ static int test_negzero() /* Test that BN_set_negative will not produce a negative zero. */ BN_zero(a); BN_set_negative(a, 1); - if (BN_is_negative(a)) { - fprintf(stderr, "BN_set_negative produced a negative zero.\n"); + if (BN_is_negative(a)) goto err; - } - st = 1; + err: BN_free(a); BN_free(b); @@ -1950,78 +1807,59 @@ err: static int test_badmod() { - BIGNUM *a = BN_new(); - BIGNUM *b = BN_new(); - BIGNUM *zero = BN_new(); - BN_MONT_CTX *mont = BN_MONT_CTX_new(); + BIGNUM *a = NULL, *b = NULL, *zero = NULL; + BN_MONT_CTX *mont = NULL; int st = 0; - if (a == NULL || b == NULL || zero == NULL || mont == NULL) + if (!TEST_ptr(a = BN_new()) + || !TEST_ptr(b = BN_new()) + || !TEST_ptr(zero = BN_new()) + || !TEST_ptr(mont = BN_MONT_CTX_new())) goto err; BN_zero(zero); - if (BN_div(a, b, BN_value_one(), zero, ctx)) { - fprintf(stderr, "Division by zero succeeded!\n"); + if (!TEST_false(BN_div(a, b, BN_value_one(), zero, ctx))) goto err; - } ERR_clear_error(); - if (BN_mod_mul(a, BN_value_one(), BN_value_one(), zero, ctx)) { - fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n"); + if (!TEST_false(BN_mod_mul(a, BN_value_one(), BN_value_one(), zero, ctx))) goto err; - } ERR_clear_error(); - if (BN_mod_exp(a, BN_value_one(), BN_value_one(), zero, ctx)) { - fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); + if (!TEST_false(BN_mod_exp(a, BN_value_one(), BN_value_one(), zero, ctx))) goto err; - } ERR_clear_error(); - if (BN_mod_exp_mont(a, BN_value_one(), BN_value_one(), zero, ctx, NULL)) { - fprintf(stderr, "BN_mod_exp_mont with zero modulus succeeded!\n"); + if (!TEST_false(BN_mod_exp_mont(a, BN_value_one(), BN_value_one(), + zero, ctx, NULL))) goto err; - } ERR_clear_error(); - if (BN_mod_exp_mont_consttime(a, BN_value_one(), BN_value_one(), - zero, ctx, NULL)) { - fprintf(stderr, - "BN_mod_exp_mont_consttime with zero modulus succeeded!\n"); + if (!TEST_false(BN_mod_exp_mont_consttime(a, BN_value_one(), BN_value_one(), + zero, ctx, NULL))) goto err; - } ERR_clear_error(); - if (BN_MONT_CTX_set(mont, zero, ctx)) { - fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); + if (!TEST_false(BN_MONT_CTX_set(mont, zero, ctx))) goto err; - } ERR_clear_error(); /* Some operations also may not be used with an even modulus. */ - if (!BN_set_word(b, 16)) + if (!TEST_true(BN_set_word(b, 16))) goto err; - if (BN_MONT_CTX_set(mont, b, ctx)) { - fprintf(stderr, - "BN_MONT_CTX_set succeeded for even modulus!\n"); + if (!TEST_false(BN_MONT_CTX_set(mont, b, ctx))) goto err; - } ERR_clear_error(); - if (BN_mod_exp_mont(a, BN_value_one(), BN_value_one(), b, ctx, NULL)) { - fprintf(stderr, - "BN_mod_exp_mont with even modulus succeeded!\n"); + if (!TEST_false(BN_mod_exp_mont(a, BN_value_one(), BN_value_one(), + b, ctx, NULL))) goto err; - } ERR_clear_error(); - if (BN_mod_exp_mont_consttime(a, BN_value_one(), BN_value_one(), - b, ctx, NULL)) { - fprintf(stderr, - "BN_mod_exp_mont_consttime with even modulus succeeded!\n"); + if (!TEST_false(BN_mod_exp_mont_consttime(a, BN_value_one(), BN_value_one(), + b, ctx, NULL))) goto err; - } ERR_clear_error(); st = 1; @@ -2035,23 +1873,27 @@ err: static int test_expmodzero() { - BIGNUM *zero = BN_new(); - BIGNUM *a = BN_new(); - BIGNUM *r = BN_new(); + BIGNUM *a = NULL, *r = NULL, *zero = NULL; int st = 0; - if (zero == NULL || a == NULL || r == NULL || !BN_rand(a, 1024, 0, 0)) + if (!TEST_ptr(zero = BN_new()) + || !TEST_ptr(a = BN_new()) + || !TEST_ptr(r = BN_new())) goto err; BN_zero(zero); - if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL) - || !BN_is_zero(r) - || !BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL) - || !BN_is_zero(r) - || !BN_mod_exp_mont_consttime(r, a, zero, BN_value_one(), NULL, NULL) - || !BN_is_zero(r) - || !BN_mod_exp_mont_word(r, 42, zero, BN_value_one(), NULL, NULL) - || !BN_is_zero(r)) + if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) + || !TEST_true(BN_is_zero(r)) + || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(), + NULL, NULL)) + || !TEST_true(BN_is_zero(r)) + || !TEST_true(BN_mod_exp_mont_consttime(r, a, zero, + BN_value_one(), + NULL, NULL)) + || !TEST_true(BN_is_zero(r)) + || !TEST_true(BN_mod_exp_mont_word(r, 42, zero, + BN_value_one(), NULL, NULL)) + || !TEST_true(BN_is_zero(r))) goto err; st = 1; @@ -2065,17 +1907,14 @@ err: static int test_smallprime() { static const int kBits = 10; - BIGNUM *r = BN_new(); + BIGNUM *r; int st = 0; - if (r == NULL - || !BN_generate_prime_ex(r, (int)kBits, 0, NULL, NULL, NULL)) - goto err; - if (BN_num_bits(r) != kBits) { - fprintf(stderr, "Expected %u bit prime, got %u bit number\n", - kBits, BN_num_bits(r)); + if (!TEST_ptr(r = BN_new()) + || !TEST_true(BN_generate_prime_ex(r, (int)kBits, 0, + NULL, NULL, NULL)) + || !TEST_int_eq(BN_num_bits(r), kBits)) goto err; - } st = 1; err: @@ -2086,18 +1925,19 @@ err: static int test_3_is_prime() { int ret = 0; - BIGNUM *r = BN_new(); + BIGNUM *r = NULL; - /* For a long time, small primes were not considered prime when - * do_trial_division was set. */ - if (r == NULL || - !BN_set_word(r, 3) || - BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx, - 0 /* do_trial_division */, NULL) != 1 || - BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx, - 1 /* do_trial_division */, NULL) != 1) { + /* + * For a long time, small primes were not considered prime when + * do_trial_division was set. + */ + if (!TEST_ptr(r = BN_new()) + || !TEST_true(BN_set_word(r, 3)) + || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx, + 0 /* do_trial_division */, NULL), 1) + || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx, + 1 /* do_trial_division */, NULL), 1)) goto err; - } ret = 1; @@ -2134,8 +1974,8 @@ static int readstanza(STANZA *s, int *linesread) while (fgets(buff, sizeof(buff), fp) != NULL) { (*linesread)++; - if ((p = strchr(buff, '\n')) == NULL) { - fprintf(stderr, "Line %d too long.\n", s->start); + if (!TEST_ptr(p = strchr(buff, '\n'))) { + TEST_info("Line %d too long", s->start); return 0; } *p = '\0'; @@ -2148,25 +1988,16 @@ static int readstanza(STANZA *s, int *linesread) if (buff[0] == '#') continue; - if ((equals = strchr(buff, '=')) == NULL) { - fprintf(stderr, "Line %d missing equals.\n", s->start); + if (!TEST_ptr(equals = strchr(buff, '='))) return 0; - } *equals++ = '\0'; - key = strip_spaces(buff); - value = strip_spaces(equals); - if (key == NULL || value == NULL) { - fprintf(stderr, "Line %d missing field.\n", s->start); - return 0; - } - s->numpairs++; - if (s->numpairs >= MAXPAIRS) { - fprintf(stderr, "Line %d too many lines\n", s->start); + if (!TEST_ptr(key = strip_spaces(buff)) + || !TEST_ptr(value = strip_spaces(equals)) + || !TEST_int_lt(s->numpairs++, MAXPAIRS) + || !TEST_ptr(pp->key = OPENSSL_strdup(key)) + || !TEST_ptr(pp->value = OPENSSL_strdup(value))) return 0; - } - pp->key = OPENSSL_strdup(key); - pp->value = OPENSSL_strdup(value); pp++; } @@ -2207,10 +2038,15 @@ static int file_test_run(STANZA *s) const FILETEST *tp = filetests; for ( ; --numtests >= 0; tp++) { - if (findattr(s, tp->name) != NULL) - return tp->func(s); + if (findattr(s, tp->name) != NULL) { + if (!tp->func(s)) { + TEST_info("Failed %s test at %d", tp->name, s->start); + return 0; + } + return 1; + } } - fprintf(stderr, "Unknown test at %d\n", s->start); + TEST_info("Unknown test at %d", s->start); return 0; } @@ -2225,7 +2061,6 @@ static int file_tests() if (s.numpairs == 0) continue; if (!file_test_run(&s)) { - fprintf(stderr, "Test at %d failed\n", s.start); errcnt++; } clearstanza(&s); @@ -2242,8 +2077,8 @@ int test_main(int argc, char *argv[]) int result = 0; if (argc != 2) { - fprintf(stderr, "%s TEST_FILE\n", argv[0]); - return 1; + TEST_error("%s TEST_FILE", argv[0]); + return 0; } ADD_TEST(test_sub); @@ -2256,7 +2091,7 @@ int test_main(int argc, char *argv[]) ADD_TEST(test_dec2bn); ADD_TEST(test_hex2bn); ADD_TEST(test_asc2bn); - ADD_TEST(test_mpi); + ADD_ALL_TESTS(test_mpi, (int)OSSL_NELEM(kMPITests)); ADD_TEST(test_negzero); ADD_TEST(test_badmod); ADD_TEST(test_expmodzero); @@ -2279,11 +2114,12 @@ int test_main(int argc, char *argv[]) ctx = BN_CTX_new(); TEST_check(ctx != NULL); - fp = fopen(argv[1], "r"); - TEST_check(fp != NULL); + if (!TEST_ptr(fp = fopen(argv[1], "r"))) + goto end; result = run_tests(argv[0]); fclose(fp); +end: BN_CTX_free(ctx); return result; } diff --git a/test/libtestutil.a b/test/libtestutil.a deleted file mode 100644 index 973419527666f587263016dfc41358af65077158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82398 zcmeHw34B%6wf?zDPPmK-qu_W!(SRirgP?#xxq5{lIAB5LT|&5l)R4psh*nwL&H@8VgDHAAg-cd+4wl_4`uC~@+l}cv% zCq)oLQ3yy8k&+j(B# zQKk@BbZ62?0(FM|z21&BC&*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