summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-03-08 06:28:08 +0000
committertb <>2023-03-08 06:28:08 +0000
commitd00b93818b38166ff03a7f9dcf6993c5acd8edbe (patch)
treef3b8cfe42d5c5a56d4d3e8dbd147355228c3bbd0
parent6718367e12207d6e0c2eb4f4ea75f16c46619449 (diff)
downloadopenbsd-d00b93818b38166ff03a7f9dcf6993c5acd8edbe.tar.gz
openbsd-d00b93818b38166ff03a7f9dcf6993c5acd8edbe.tar.bz2
openbsd-d00b93818b38166ff03a7f9dcf6993c5acd8edbe.zip
bn_isqrt: reduce number of tests to 100.
The runtime is roughly quadratic in N_TESTS. While it only takes 1-2s on modern machines, this test takes a long time on slow machines. A reduction of runtime by a factor of ~16 is significant.
-rw-r--r--src/regress/lib/libcrypto/bn/bn_isqrt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_isqrt.c b/src/regress/lib/libcrypto/bn/bn_isqrt.c
index b1cacea1cd..2663bb74e9 100644
--- a/src/regress/lib/libcrypto/bn/bn_isqrt.c
+++ b/src/regress/lib/libcrypto/bn/bn_isqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_isqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ 1/* $OpenBSD: bn_isqrt.c,v 1.3 2023/03/08 06:28:08 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -26,7 +26,7 @@
26 26
27#include "bn_local.h" 27#include "bn_local.h"
28 28
29#define N_TESTS 400 29#define N_TESTS 100
30 30
31/* Sample squares between 2^128 and 2^4096. */ 31/* Sample squares between 2^128 and 2^4096. */
32#define LOWER_BITS 128 32#define LOWER_BITS 128