diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_gcd.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_gcd.c b/src/regress/lib/libcrypto/bn/bn_gcd.c index 018cc6ea75..b247b9b2a9 100644 --- a/src/regress/lib/libcrypto/bn/bn_gcd.c +++ b/src/regress/lib/libcrypto/bn/bn_gcd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_gcd.c,v 1.2 2023/04/06 07:07:54 tb Exp $ */ | 1 | /* $OpenBSD: bn_gcd.c,v 1.3 2023/04/07 17:09:54 tb Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> |
@@ -3495,13 +3495,16 @@ bn_gcd_test(const struct gcd_test *testcase) | |||
3495 | BN_set_negative(b, (signs >> 1) & 1); | 3495 | BN_set_negative(b, (signs >> 1) & 1); |
3496 | 3496 | ||
3497 | if (!test->fn(got, a, b, ctx)) { | 3497 | if (!test->fn(got, a, b, ctx)) { |
3498 | fprintf(stderr, "boo\n"); | 3498 | fprintf(stderr, "%s(%s, %s) failed\n", |
3499 | test->name, testcase->a, testcase->b); | ||
3499 | goto err; | 3500 | goto err; |
3500 | } | 3501 | } |
3501 | 3502 | ||
3502 | if (BN_cmp(got, want) != 0) { | 3503 | if (BN_cmp(got, want) != 0) { |
3503 | fprintf(stderr, "%s, signs %d, want %s, got ", | 3504 | fprintf(stderr, "a: %s\n", testcase->a); |
3504 | test->name, signs, testcase->r); | 3505 | fprintf(stderr, "b: %s\n", testcase->b); |
3506 | fprintf(stderr, "%s, i: %zu, signs %d, want %s, got ", | ||
3507 | test->name, i, signs, testcase->r); | ||
3505 | BN_print_fp(stderr, got); | 3508 | BN_print_fp(stderr, got); |
3506 | fprintf(stderr, "\n"); | 3509 | fprintf(stderr, "\n"); |
3507 | 3510 | ||
@@ -3568,9 +3571,13 @@ bn_binomial_gcd_test(const struct gcd_test_fn *test, int k, BIGNUM *a, | |||
3568 | } | 3571 | } |
3569 | 3572 | ||
3570 | if (BN_ucmp(gcd, b) != 0) { | 3573 | if (BN_ucmp(gcd, b) != 0) { |
3571 | fprintf(stderr, "%s: BN_ucmp() failed, " | 3574 | fprintf(stderr, "%s: BN_ucmp(gcd, b) failed, " |
3572 | "k: %d, shift: %d, signs %d\n", | 3575 | "k: %d, shift: %d, signs %d\n", |
3573 | test->name, k, shift, signs); | 3576 | test->name, k, shift, signs); |
3577 | BN_print_fp(stderr, gcd); | ||
3578 | fprintf(stderr, "\n"); | ||
3579 | BN_print_fp(stderr, b); | ||
3580 | fprintf(stderr, "\n"); | ||
3574 | failed |= 1; | 3581 | failed |= 1; |
3575 | } | 3582 | } |
3576 | } | 3583 | } |