fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 8 Oct 2010 14:08:01 +0000 (14:08 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 8 Oct 2010 14:08:01 +0000 (14:08 +0000)
src/util/crypto_ksk.c

index 6136fbf43a13c285d9c546295d90e74221f4d7c7..af0905a33b96d4c2cec1591724d5a19a92c633e5 100644 (file)
@@ -325,7 +325,8 @@ gen_prime (gcry_mpi_t *ptest, unsigned int nbits, GNUNET_HashCode * hc)
           size_t written;
 
           gcry_mpi_set_ui(sp, x);
-          gcry_mpi_div (NULL, tmp, prime, sp, -1 /* TODO CG: is this correct? */);
+          gcry_mpi_div (NULL, tmp, prime, sp, -1);
+         mods[i] = 0;
           gcry_mpi_print (GCRYMPI_FMT_USG, (unsigned char *) &mods[i], sizeof(*mods), &written, tmp);
         }
       gcry_mpi_release (sp);
@@ -419,8 +420,7 @@ generate_kblock_key (KBlock_secret_key * sk,
       gcry_mpi_sub_ui (t2, sk->q, 1);
       gcry_mpi_mul (phi, t1, t2);
       gcry_mpi_gcd (g, t1, t2);
-      gcry_mpi_div (f, NULL, phi, g, -1 /* TODO CG: is this correct? */);
-
+      gcry_mpi_div (f, NULL, phi, g, 0);
       while (0 == gcry_mpi_gcd (t1, sk->e, phi))
         {                       /* (while gcd is not 1) */
           gcry_mpi_add_ui (sk->e, sk->e, 2);