summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-03-08 06:28:08 +0000
committertb <>2023-03-08 06:28:08 +0000
commit8a2cc3425848fef02e282071f4d343963854fa0d (patch)
treef3b8cfe42d5c5a56d4d3e8dbd147355228c3bbd0 /src
parent6edb0a56e6aa12c3ee96cf27ee601fb464869235 (diff)
downloadopenbsd-8a2cc3425848fef02e282071f4d343963854fa0d.tar.gz
openbsd-8a2cc3425848fef02e282071f4d343963854fa0d.tar.bz2
openbsd-8a2cc3425848fef02e282071f4d343963854fa0d.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.
Diffstat (limited to 'src')
-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