More W32 resolver workarounds
[oweals/gnunet.git] / src / include / gnunet_crypto_lib.h
index 08f848b1cd76881ef3a6c866aa39526dfac19c5c..a82b2fdd63d7360ac2fc3d27045e414d4e090be4 100644 (file)
@@ -110,6 +110,12 @@ enum GNUNET_CRYPTO_Quality
  */
 #define GNUNET_CRYPTO_HASH_LENGTH (512/8)
 
+/**
+ * How many characters (without 0-terminator) are our ASCII-encoded
+ * public keys (ECDSA/EDDSA/ECDHE).
+ */
+#define GNUNET_CRYPTO_PKEY_ASCII_LENGTH 52
+
 /**
  * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode.
  */
@@ -446,14 +452,14 @@ GNUNET_CRYPTO_symmetric_create_session_key (struct GNUNET_CRYPTO_SymmetricSessio
  * Encrypt a block using a symmetric sessionkey.
  *
  * @param block the block to encrypt
- * @param len the size of the block
+ * @param size the size of the @a block
  * @param sessionkey the key used to encrypt
  * @param iv the initialization vector to use, use INITVALUE
  *        for streams.
  * @return the size of the encrypted block, -1 for errors
  */
 ssize_t
-GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t len,
+GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t size,
                                  const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
                                  const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
                                  void *result);
@@ -1096,6 +1102,19 @@ int
 GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  struct GNUNET_PeerIdentity *dst);
 
+/**
+ * Compare two Peer Identities.
+ *
+ * @param first first peer identity
+ * @param second second peer identity
+ * @return bigger than 0 if first > second,
+ *         0 if they are the same
+ *         smaller than 0 if second > first
+ */
+int
+GNUNET_CRYPTO_cmp_peer_identity (const struct GNUNET_PeerIdentity *first,
+                                 const struct GNUNET_PeerIdentity *second);
+
 
 /**
  * @ingroup crypto