Add a third default.
[oweals/gnunet.git] / src / util / crypto_ecc.c
index 1fd41b32718488b9e7c77eb06e90aacc8893c2ad..c5e3b10084a1c93d1bdb027a610b00b9766cefc0 100644 (file)
@@ -550,7 +550,7 @@ GNUNET_CRYPTO_ecdhe_key_create ()
 
   if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
                                   "(genkey(ecc(curve \"" CURVE "\")"
-                                  "(flags noparam)))")))
+                                  "(flags)))")))
   {
     LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
     return NULL;
@@ -600,7 +600,7 @@ GNUNET_CRYPTO_ecdsa_key_create ()
 
   if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
                                   "(genkey(ecc(curve \"" CURVE "\")"
-                                  "(flags noparam)))")))
+                                  "(flags)))")))
   {
     LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
     return NULL;
@@ -649,7 +649,7 @@ GNUNET_CRYPTO_eddsa_key_create ()
 
   if (0 != (rc = gcry_sexp_build (&s_keyparam, NULL,
                                   "(genkey(ecc(curve \"" CURVE "\")"
-                                  "(flags noparam eddsa)))")))
+                                  "(flags eddsa)))")))
   {
     LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
     return NULL;
@@ -1437,9 +1437,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
   GNUNET_assert (0 ==
                  gcry_mpi_print (GCRYMPI_FMT_STD, xbuf, rsize, &rsize,
                                  result_x));
-  GNUNET_assert (rsize == sizeof (xbuf));
-  mpi_print (xbuf, sizeof (xbuf), result_x);
-  GNUNET_CRYPTO_hash (xbuf, sizeof (xbuf), key_material);
+  GNUNET_CRYPTO_hash (xbuf, rsize, key_material);
   gcry_mpi_release (result_x);
   return GNUNET_OK;
 }