-fix
[oweals/gnunet.git] / src / include / gnunet_crypto_lib.h
index 8270c89dd9c8b2bd42ac827579ce54e395e8583f..777ddd97e6a811259ab30ee9d5fc40dda801e486 100644 (file)
@@ -512,6 +512,18 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
   GNUNET_CRYPTO_short_hash_from_string2 (enc, strlen(enc), result)
 
 
+/**
+ * Compare function for ShortHashCodes, producing a total ordering
+ * of all hashcodes.
+ *
+ * @param h1 some hash code
+ * @param h2 some hash code
+ * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
+ */
+int
+GNUNET_CRYPTO_short_hash_cmp (const struct GNUNET_CRYPTO_ShortHashCode * h1,
+                              const struct GNUNET_CRYPTO_ShortHashCode * h2);
+
 /**
  * Compute the distance between 2 hashcodes.
  * The computation must be fast, not involve
@@ -565,7 +577,7 @@ GNUNET_CRYPTO_short_hash_double (const struct GNUNET_CRYPTO_ShortHashCode *sh,
 /**
  * Truncate doubled short hash back to a short hash.
  *
- * @param lh doubled short hash to reduce again
+ * @param dh doubled short hash to reduce again
  * @param sh where to store the short hash
  * @return GNUNET_OK on success, GNUNET_SYSERR if this was not a
  *         doubled short hash