(generate): Tweak to allow keys larger than 1024 bits. Enforce that the q
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 20 Apr 2006 21:11:56 +0000 (21:11 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 20 Apr 2006 21:11:56 +0000 (21:11 +0000)
size doesn't end between byte boundaries.

cipher/ChangeLog
cipher/dsa.c

index 3448f75..869ae65 100644 (file)
@@ -2,6 +2,8 @@
 
        * dsa.c (dsa2_generate): New function to generate a DSA key with a
        variable sized q.
+       (generate): Tweak to allow keys larger than 1024 bits.  Enforce
+       that the q size doesn't end between byte boundaries.
 
 2006-04-19  David Shaw  <dshaw@jabberwocky.com>
 
index 447cea9..9745656 100644 (file)
@@ -180,8 +180,9 @@ generate( DSA_secret_key *sk, unsigned nbits, unsigned qbits,
     MPI h, e;  /* helper */
     byte *rndbuf;
 
-    assert( nbits >= 512 && nbits <= 1024 );
+    assert( nbits >= 512 );
     assert( qbits >= 160 );
+    assert( qbits %8 == 0 );
 
     p = generate_elg_prime( 1, nbits, qbits, NULL, ret_factors );
     /* get q out of factors */