summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regress/lib/libcrypto/exp/exptest.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/regress/lib/libcrypto/exp/exptest.c b/src/regress/lib/libcrypto/exp/exptest.c
index ea744c22ea..9a7a769e07 100644
--- a/src/regress/lib/libcrypto/exp/exptest.c
+++ b/src/regress/lib/libcrypto/exp/exptest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: exptest.c,v 1.9 2022/12/01 02:58:40 jsing Exp $ */ 1/* $OpenBSD: exptest.c,v 1.10 2022/12/01 21:13:58 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -211,7 +211,8 @@ test_exp_mod_zero(void)
211 return ret; 211 return ret;
212} 212}
213 213
214int main(int argc, char *argv[]) 214int
215main(int argc, char *argv[])
215{ 216{
216 BIGNUM *r_mont, *r_mont_const, *r_recp, *r_simple; 217 BIGNUM *r_mont, *r_mont_const, *r_recp, *r_simple;
217 BIGNUM *r_mont_ct, *r_mont_nonct, *a, *b, *m; 218 BIGNUM *r_mont_ct, *r_mont_nonct, *a, *b, *m;
@@ -299,12 +300,9 @@ int main(int argc, char *argv[])
299 goto err; 300 goto err;
300 } 301 }
301 302
302 if (BN_cmp(r_simple, r_mont) == 0 && 303 if (BN_cmp(r_simple, r_mont) != 0 ||
303 BN_cmp(r_simple, r_recp) == 0 && 304 BN_cmp(r_simple, r_recp) != 0 ||
304 BN_cmp(r_simple, r_mont_const) == 0) { 305 BN_cmp(r_simple, r_mont_const) != 0) {
305 printf(".");
306 fflush(stdout);
307 } else {
308 if (BN_cmp(r_simple, r_mont) != 0) 306 if (BN_cmp(r_simple, r_mont) != 0)
309 printf("\nsimple and mont results differ\n"); 307 printf("\nsimple and mont results differ\n");
310 if (BN_cmp(r_simple, r_mont_const) != 0) 308 if (BN_cmp(r_simple, r_mont_const) != 0)
@@ -347,13 +345,10 @@ int main(int argc, char *argv[])
347 ERR_remove_thread_state(NULL); 345 ERR_remove_thread_state(NULL);
348 CRYPTO_mem_leaks(out); 346 CRYPTO_mem_leaks(out);
349 BIO_free(out); 347 BIO_free(out);
350 printf("\n");
351 348
352 if (test_exp_mod_zero() != 0) 349 if (test_exp_mod_zero() != 0)
353 goto err; 350 goto err;
354 351
355 printf("done\n");
356
357 return (0); 352 return (0);
358 353
359 err: 354 err: