2023-10-03 Niels Möller <nisse@lysator.liu.se>
+ * testsuite/ecc-mod-arith-test.c: Reduce test count, aiming to get
+ test to complete in roughly 0.1s.
+ * testsuite/ecc-mod-test.c: Likewise.
+ * testsuite/ecc-modinv-test.c: Likewise.
+ * testsuite/ecc-mul-a-test.c: Likewise.
+ * testsuite/ecc-redc-test.c: Likewise.
+ * testsuite/ecc-sqrt-test.c: Likewise.
+ * testsuite/eddsa-compress-test.c: Likewise.
+ * testsuite/poly1305-test.c: Likewise.
+ * testsuite/random-prime-test.c: Likewise.
+ * testsuite/rsa-compute-root-test.c: Likewise.
+ * testsuite/rsa-sec-decrypt-test.c: Likewise.
+
* testsuite/Makefile.in (TS_SH): Delete tools tests from list.
* tools/Makefile.in (check): Run tools tests from this target.
(TS_ALL): New variable.
#include "testutils.h"
#define MAX_SIZE (1 + 521 / GMP_NUMB_BITS)
-#define COUNT 50000
+#define COUNT 10000
static void
test_add(const char *name,
test_main (void)
{
gmp_randstate_t rands;
- unsigned count = COUNT;
unsigned i;
gmp_randinit_default (rands);
- if (test_randomize(rands))
- count *= 20;
+ test_randomize(rands);
for (i = 0; ecc_curves[i]; i++)
{
- test_modulo (rands, "p", &ecc_curves[i]->p, count);
- test_modulo (rands, "q", &ecc_curves[i]->q, count);
+ test_modulo (rands, "p", &ecc_curves[i]->p, COUNT);
+ test_modulo (rands, "q", &ecc_curves[i]->q, COUNT);
}
gmp_randclear (rands);
}
#define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS)
#define MAX_SIZE (2*MAX_ECC_SIZE)
-#define COUNT 50000
+#define COUNT 10000
/* Destructively normalize tp, then compare */
static int
test_main (void)
{
gmp_randstate_t rands;
- unsigned count = COUNT;
unsigned i;
gmp_randinit_default (rands);
test_patterns ("q", &ecc_curves[i]->p);
}
- if (test_randomize(rands))
- count *= 20;
+ test_randomize(rands);
for (i = 0; ecc_curves[i]; i++)
{
- test_modulo (rands, "p", &ecc_curves[i]->p, count);
- test_modulo (rands, "q", &ecc_curves[i]->q, count);
+ test_modulo (rands, "p", &ecc_curves[i]->p, COUNT);
+ test_modulo (rands, "q", &ecc_curves[i]->q, COUNT);
}
gmp_randclear (rands);
}
}
#define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS)
-#define COUNT 500
+#define COUNT 200
static void
test_modulo (gmp_randstate_t rands, const char *name,
mpn_zero (n, size);
- for (j = 0; j < 100; j++)
+ for (j = 0; j < 30; j++)
{
if (j & 1)
mpz_rrandomb (r, rands, size * GMP_NUMB_BITS);
#define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS)
#define MAX_SIZE (2*MAX_ECC_SIZE)
-#define COUNT 50000
+#define COUNT 10000
void
test_main (void)
#include "testutils.h"
-#define COUNT 5000
+#define COUNT 500
#if NETTLE_USE_MINI_GMP
/* Implements Legendre symbol only, requiring that p is an odd prime */
#include "eddsa.h"
#include "eddsa-internal.h"
-#define COUNT 1000
+#define COUNT 500
void test_main (void)
{
}
}
-#define COUNT 100000
+#define COUNT 10000
#define MAX_MESSAGE_SIZE 300
static void
knuth_lfib_init(&lfib, 17);
mpz_init(p);
- for (bits = 6; bits < 1000; bits = bits + 1 + bits/20)
+ for (bits = 6; bits < 1000; bits = bits + 1 + bits/10)
{
if (verbose)
fprintf(stderr, "bits = %d\n", bits);
#include "rsa.h"
-#define KEY_COUNT 20
-#define COUNT 100
+#define KEY_COUNT 10
+#define COUNT 50
static void
random_fn (void *ctx, size_t n, uint8_t *dst)
unsigned n_size = 1024;
mpz_t gibberish;
mpz_t garbage;
- size_t size;
+ unsigned count;
rsa_private_key_init(&key);
rsa_public_key_init(&pub);
memset(verifybad, 'A', PAYLOAD_SIZE);
- for (size = 1; size < 51; size++)
+ for (count = 1; count < 20; count++)
{
ASSERT (rsa_generate_keypair(&pub, &key, &random_ctx,
(nettle_random_func *) knuth_lfib_random,