aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_crypto_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-13 16:19:10 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-13 16:19:10 +0000
commit55d612a4f2b68911b472d10bb7efd50d8740fe6e (patch)
tree95adabb8bee4032937a6ab9f19ec758896caf94f /src/include/gnunet_crypto_lib.h
parent4725d59b468f1f30ba2910992333ca157682ce29 (diff)
downloadgnunet-55d612a4f2b68911b472d10bb7efd50d8740fe6e.tar.gz
gnunet-55d612a4f2b68911b472d10bb7efd50d8740fe6e.zip
towards using EdDSA-ECDHE instead of ECDSA-ECDHE combined cryptosystem (API only)
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r--src/include/gnunet_crypto_lib.h63
1 files changed, 34 insertions, 29 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index da31e9741..81be6f3de 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -1041,34 +1041,6 @@ GNUNET_CRYPTO_eddsa_key_get_public (const struct GNUNET_CRYPTO_EddsaPrivateKey *
1041 1041
1042/** 1042/**
1043 * @ingroup crypto 1043 * @ingroup crypto
1044 * Convert ECDSA public key to ECDHE public key.
1045 * Please be very careful when using this function, as mixing
1046 * cryptographic primitives is not always healthy.
1047 *
1048 * @param ecdsa ecdsa public key
1049 * @param ecdhe[OUT] ecdhe public key
1050 */
1051void
1052GNUNET_CRYPTO_ecdsa_public_to_ecdhe (const struct GNUNET_CRYPTO_EcdsaPublicKey *ecdsa,
1053 struct GNUNET_CRYPTO_EcdhePublicKey *ecdhe);
1054
1055
1056/**
1057 * @ingroup crypto
1058 * Convert ECDSA private key to ECDHE private key.
1059 * Please be very careful when using this function, as mixing
1060 * cryptographic primitives is not always healthy.
1061 *
1062 * @param ecdsa ecdsa private key
1063 * @param ecdhe[OUT] ecdhe private key
1064 */
1065void
1066GNUNET_CRYPTO_ecdsa_private_to_ecdhe (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa,
1067 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe);
1068
1069
1070/**
1071 * @ingroup crypto
1072 * Extract the public key for the given private key. 1044 * Extract the public key for the given private key.
1073 * 1045 *
1074 * @param priv the private key 1046 * @param priv the private key
@@ -1247,6 +1219,7 @@ GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk);
1247void 1219void
1248GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); 1220GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk);
1249 1221
1222
1250/** 1223/**
1251 * @ingroup crypto 1224 * @ingroup crypto
1252 * Clear memory that was used to store a private key. 1225 * Clear memory that was used to store a private key.
@@ -1325,6 +1298,38 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1325 1298
1326/** 1299/**
1327 * @ingroup crypto 1300 * @ingroup crypto
1301 * Derive key material from a ECDH public key and a private EdDSA key.
1302 * Dual to #GNUNET_CRRYPTO_ecdh_eddsa.
1303 *
1304 * @param priv private key from EdDSA to use for the ECDH (x)
1305 * @param pub public key to use for the ECDH (yG)
1306 * @param key_material where to write the key material H(h(x)yG)
1307 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1308 */
1309int
1310GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1311 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1312 struct GNUNET_HashCode *key_material);
1313
1314
1315/**
1316 * @ingroup crypto
1317 * Derive key material from a EdDSA public key and a private ECDH key.
1318 * Dual to #GNUNET_CRRYPTO_eddsa_ecdh.
1319 *
1320 * @param priv private key to use for the ECDH (y)
1321 * @param pub public key from EdDSA to use for the ECDH (X=h(x)G)
1322 * @param key_material where to write the key material H(yX)=H(h(x)yG)
1323 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1324 */
1325int
1326GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1327 const struct GNUNET_CRYPTO_EddsaPublicKey *pub,
1328 struct GNUNET_HashCode *key_material);
1329
1330
1331/**
1332 * @ingroup crypto
1328 * EdDSA sign a given block. 1333 * EdDSA sign a given block.
1329 * 1334 *
1330 * @param priv private key to use for the signing 1335 * @param priv private key to use for the signing
@@ -1666,7 +1671,7 @@ GNUNET_CRYPTO_rsa_blinding_key_create (unsigned int len);
1666 1671
1667/** 1672/**
1668 * Compare the values of two blinding keys. 1673 * Compare the values of two blinding keys.
1669 * 1674 *
1670 * @param b1 one key 1675 * @param b1 one key
1671 * @param b2 the other key 1676 * @param b2 the other key
1672 * @return 0 if the two are equal 1677 * @return 0 if the two are equal