struct GNUNET_CRYPTO_EddsaPublicKey
{
/**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
- *
- * FIXME: this coordinate will be removed in the future (compressed point!).
- */
- unsigned char q_x[256 / 8];
-
- /**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
+ * Q consists of an x- and a y-value, each mod p (256 bits), given
+ * here in affine coordinates and Ed25519 standard compact format.
*/
unsigned char q_y[256 / 8];
struct GNUNET_CRYPTO_EcdsaPublicKey
{
/**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
- *
- * FIXME: this coordinate will be removed in the future (compressed point!).
- */
- unsigned char q_x[256 / 8];
-
- /**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
+ * Q consists of an x- and a y-value, each mod p (256 bits), given
+ * here in affine coordinates and Ed25519 standard compact format.
*/
unsigned char q_y[256 / 8];
struct GNUNET_CRYPTO_EcdhePublicKey
{
/**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
- */
- unsigned char q_x[256 / 8];
-
- /**
- * Q consists of an x- and a y-value, each mod p (256 bits),
- * given here in affine coordinates.
- *
- * FIXME: this coordinate will be removed in the future (compressed point!).
+ * Q consists of an x- and a y-value, each mod p (256 bits), given
+ * here in affine coordinates and Ed25519 standard compact format.
*/
unsigned char q_y[256 / 8];
-
};
* 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);
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