diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-19 13:21:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-19 13:21:30 +0000 |
commit | c641b74c2e060528100168f44c074526798c1623 (patch) | |
tree | f4a56b64f3483c03d77f4b2722c416e55e5d4c15 /src/util/crypto_ecc.c | |
parent | 7e76381a7d5ff4fe908542f17f76f81b99a5fb04 (diff) | |
download | gnunet-c641b74c2e060528100168f44c074526798c1623.tar.gz gnunet-c641b74c2e060528100168f44c074526798c1623.zip |
-also cover private key case
Diffstat (limited to 'src/util/crypto_ecc.c')
-rw-r--r-- | src/util/crypto_ecc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 25393cbf6..429d2bf4b 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -1561,4 +1561,27 @@ GNUNET_CRYPTO_ecdsa_public_to_ecdhe (const struct GNUNET_CRYPTO_EcdsaPublicKey * | |||
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | 1563 | ||
1564 | |||
1565 | /** | ||
1566 | * @ingroup crypto | ||
1567 | * Convert ECDSA private key to ECDHE private key. | ||
1568 | * Please be very careful when using this function, as mixing | ||
1569 | * cryptographic primitives is not always healthy. | ||
1570 | * | ||
1571 | * @param ecdsa ecdsa private key | ||
1572 | * @param ecdhe[OUT] ecdhe private key | ||
1573 | */ | ||
1574 | void | ||
1575 | GNUNET_CRYPTO_ecdsa_private_to_ecdhe (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa, | ||
1576 | struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe) | ||
1577 | { | ||
1578 | GNUNET_assert (sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey) == | ||
1579 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)); | ||
1580 | memcpy (ecdhe, | ||
1581 | ecdsa, | ||
1582 | sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey)); | ||
1583 | |||
1584 | } | ||
1585 | |||
1586 | |||
1564 | /* end of crypto_ecc.c */ | 1587 | /* end of crypto_ecc.c */ |