-fix ftbfs
authorChristian Grothoff <christian@grothoff.org>
Sat, 5 Sep 2015 22:32:52 +0000 (22:32 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 5 Sep 2015 22:32:52 +0000 (22:32 +0000)
po/POTFILES.in
src/include/gnunet_crypto_lib.h
src/util/crypto_ecc_dlog.c

index d756a2c377844e9b05680126b3698410c41d223d..b36509fdf9bef3b2e43226400606baf3e262b5e8 100644 (file)
@@ -250,9 +250,9 @@ src/psyc/gnunet-service-psyc.c
 src/psyc/psyc_api.c
 src/psycstore/gnunet-service-psycstore.c
 src/psycstore/plugin_psycstore_sqlite.c
-src/psycstore/psyc_util_lib.c
 src/psycstore/psycstore_api.c
 src/psycstore/psyc_util_lib.c
+src/psycstore/psyc_util_lib.c
 src/pt/gnunet-daemon-pt.c
 src/regex/gnunet-daemon-regexprofiler.c
 src/regex/gnunet-regex-profiler.c
@@ -446,6 +446,7 @@ src/util/server_nc.c
 src/util/server_tc.c
 src/util/service.c
 src/util/signal.c
+src/util/socks.c
 src/util/speedup.c
 src/util/strings.c
 src/util/time.c
index e3d938382a95f70ff3800e9dd52d0de3851075d4..33ad1af2be27230423a3f4a3871a8de53d84bd48 100644 (file)
@@ -1426,6 +1426,20 @@ GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccDlogContext *edc,
                       gcry_mpi_point_t *r_inv);
 
 
+/**
+ * Obtain a random scalar for point multiplication on the curve and
+ * its multiplicative inverse.
+ *
+ * @param edc calculation context for ECC operations
+ * @param[out] r set to a random scalar on the curve
+ * @param[out] r_inv set to the multiplicative inverse of @a r
+ */
+void
+GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
+                           gcry_mpi_t *r,
+                           gcry_mpi_t *r_inv);
+
+
 /**
  * Generate a random value mod n.
  *
index 29cba3336faf8d64df23c7e1beebcc0f30b47ac9..1254a036e27ff83a814e7ea30eb7484daf01cb31 100644 (file)
@@ -466,6 +466,29 @@ GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccDlogContext *edc,
 }
 
 
+/**
+ * Obtain a random scalar for point multiplication on the curve and
+ * its multiplicative inverse.
+ *
+ * @param edc calculation context for ECC operations
+ * @param[out] r set to a random scalar on the curve
+ * @param[out] r_inv set to the multiplicative inverse of @a r
+ */
+void
+GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
+                           gcry_mpi_t *r,
+                           gcry_mpi_t *r_inv)
+{
+  gcry_mpi_t n;
+
+  *r = GNUNET_CRYPTO_ecc_random_mod_n (edc);
+  /* r_inv = n - r = - r */
+  *r_inv = gcry_mpi_new (0);
+  n = gcry_mpi_ec_get_mpi ("n", edc->ctx, 1);
+  gcry_mpi_sub (*r_inv, n, *r);
+}
+
+
 /**
  * Free a point value returned by the API.
  *