aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_crypto_lib.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-01-04 12:43:47 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-01-04 12:43:47 +0000
commit588c1bd23e49f3264bdfdb3b02c7cf6e78b66534 (patch)
tree2fe3b1f9e930a75675eb7e75aaab5100cb13ab54 /src/include/gnunet_crypto_lib.h
parent1af781131216a54772885e8514d5a9c9ef2f6cd0 (diff)
downloadgnunet-588c1bd23e49f3264bdfdb3b02c7cf6e78b66534.tar.gz
gnunet-588c1bd23e49f3264bdfdb3b02c7cf6e78b66534.zip
- Add ecdsa ecdh functions
- Update identity token to encrypted protocol
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r--src/include/gnunet_crypto_lib.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 33ad1af2b..2ec3b4d8d 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -1498,6 +1498,21 @@ GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1498 const struct GNUNET_CRYPTO_EcdhePublicKey *pub, 1498 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1499 struct GNUNET_HashCode *key_material); 1499 struct GNUNET_HashCode *key_material);
1500 1500
1501/**
1502 * @ingroup crypto
1503 * Derive key material from a ECDH public key and a private ECDSA key.
1504 * Dual to #GNUNET_CRRYPTO_ecdh_ecdsa.
1505 *
1506 * @param priv private key from ECDSA to use for the ECDH (x)
1507 * @param pub public key to use for the ECDH (yG)
1508 * @param key_material where to write the key material H(h(x)yG)
1509 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1510 */
1511int
1512GNUNET_CRYPTO_ecdsa_ecdh (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1513 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1514 struct GNUNET_HashCode *key_material);
1515
1501 1516
1502/** 1517/**
1503 * @ingroup crypto 1518 * @ingroup crypto
@@ -1514,6 +1529,21 @@ GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1514 const struct GNUNET_CRYPTO_EddsaPublicKey *pub, 1529 const struct GNUNET_CRYPTO_EddsaPublicKey *pub,
1515 struct GNUNET_HashCode *key_material); 1530 struct GNUNET_HashCode *key_material);
1516 1531
1532/**
1533 * @ingroup crypto
1534 * Derive key material from a EcDSA public key and a private ECDH key.
1535 * Dual to #GNUNET_CRRYPTO_ecdsa_ecdh.
1536 *
1537 * @param priv private key to use for the ECDH (y)
1538 * @param pub public key from ECDSA to use for the ECDH (X=h(x)G)
1539 * @param key_material where to write the key material H(yX)=H(h(x)yG)
1540 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1541 */
1542int
1543GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1544 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
1545 struct GNUNET_HashCode *key_material);
1546
1517 1547
1518/** 1548/**
1519 * @ingroup crypto 1549 * @ingroup crypto