]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Add test for dsa key generation with large q. dsa-reorg
authorNiels Möller <nisse@lysator.liu.se>
Tue, 25 Mar 2014 15:54:10 +0000 (16:54 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 25 Mar 2014 15:54:10 +0000 (16:54 +0100)
ChangeLog
testsuite/dsa-keygen-test.c

index 2c2d75f466c6cb48dc4c5830de8efc1bb1b048cc..869992a697b8b7744f91b376a668c553dd801891 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2014-03-25  Niels Möller  <nisse@lysator.liu.se>
 
        * testsuite/dsa-keygen-test.c (test_main): Do dsa_param cast once,
-       and assign to variable.
+       and assign to variable. Test dsa_generate_params and
+       dsa_generate_keypair with a large q; p_bits = 1024, q_bits = 768.
 
        * dsa.h: Deleted old interface (moved to dsa-compat.h).
        (struct dsa_value): Deleted. Updated many files.
index 25757c95fb606606c1b466a38cb70f298cc0d05a..bdfb3632461da781f5460729bf4c450a165db78e 100644 (file)
@@ -49,6 +49,21 @@ 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);