diff options
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 63 |
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 | */ | ||
1051 | void | ||
1052 | GNUNET_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 | */ | ||
1065 | void | ||
1066 | GNUNET_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); | |||
1247 | void | 1219 | void |
1248 | GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); | 1220 | GNUNET_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 | */ | ||
1309 | int | ||
1310 | GNUNET_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 | */ | ||
1325 | int | ||
1326 | GNUNET_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 |