Skip to content
Snippets Groups Projects
Commit 7fa4ac23 authored by Niels Möller's avatar Niels Möller
Browse files

Test dsa_generate_params with large q.

parent c165b7b2
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,9 @@
* testsuite/dsa-keygen-test.c (test_main): Explicitly use
dsa_compat_generate_keypair.
(test_main): Test dsa_generate_params and dsa_generate_keypair
with a large q; p_bits = 1024, q_bits = 768.
* testsuite/testutils.h: Undo dsa-compat.h name mangling.
* dsa-keygen.c (dsa_generate_keypair): New interface, generating
......
......@@ -50,6 +50,20 @@ test_main(void)
test_dsa_key(params, pub.y, key.x, 224);
test_dsa256(&pub, &key, NULL);
/* Test with large q */
if (!dsa_generate_params (params,
&lfib,
(nettle_random_func *) knuth_lfib_random,
NULL, verbose ? progress : NULL,
1024, 768))
FAIL();
dsa_generate_keypair (params, pub.y, key.x,
&lfib,
(nettle_random_func *) knuth_lfib_random);
test_dsa_key(params, pub.y, key.x, 768);
test_dsa256(&pub, &key, NULL);
dsa_public_key_clear(&pub);
dsa_private_key_clear(&key);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment