Link libgnunetblockgroup to libgnunetblock
[oweals/gnunet.git] / src / util / crypto_ecc_dlog.c
index 1254a036e27ff83a814e7ea30eb7484daf01cb31..38e2088cc07780e5c436647fae7400e046f5d304 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2012, 2013, 2015 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2012, 2013, 2015 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -151,7 +151,7 @@ GNUNET_CRYPTO_ecc_bin_to_point (struct GNUNET_CRYPTO_EccDlogContext *edc,
  *
  * @param max maximum value the factor can be
  * @param mem memory to use (should be smaller than @a max), must not be zero.
- * @return @a max if dlog failed, otherwise the factor
+ * @return NULL on error
  */
 struct GNUNET_CRYPTO_EccDlogContext *
 GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max,
@@ -219,7 +219,7 @@ GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max,
  *
  * @param edc precalculated values, determine range of factors
  * @param input point on the curve to factor
- * @return `edc->max` if dlog failed, otherwise the factor
+ * @return INT_MAX if dlog failed, otherwise the factor
  */
 int
 GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc,
@@ -237,7 +237,7 @@ GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc,
   GNUNET_assert (NULL != g);
   q = gcry_mpi_point_new (0);
 
-  res = edc->max;
+  res = INT_MAX;
   for (i=0;i<=edc->max/edc->mem;i++)
   {
     if (0 == i)