From 4caa6fad4c71391ab41e92a32aa58b10b6febe7f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 Aug 2014 00:18:26 -0400 Subject: Add curve25519->ed25519 key conversion per proposal 228 For proposal 228, we need to cross-certify our identity with our curve25519 key, so that we can prove at descriptor-generation time that we own that key. But how can we sign something with a key that is only for doing Diffie-Hellman? By converting it to the corresponding ed25519 point. See the ALL-CAPS warning in the documentation. According to djb (IIUC), it is safe to use these keys in the ways that ntor and prop228 are using them, but it might not be safe if we start providing crazy oracle access. (Unit tests included. What kind of a monster do you take me for?) --- src/common/crypto_ed25519.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common/crypto_ed25519.h') diff --git a/src/common/crypto_ed25519.h b/src/common/crypto_ed25519.h index f37dd5b770..82c5e6c6e3 100644 --- a/src/common/crypto_ed25519.h +++ b/src/common/crypto_ed25519.h @@ -67,6 +67,15 @@ typedef struct { int ed25519_checksig_batch(int *okay_out, const ed25519_checkable_t *checkable, int n_checkable); + +int ed25519_keypair_from_curve25519_keypair(ed25519_keypair_t *out, + int *signbit_out, + const curve25519_keypair_t *inp); + +int ed25519_public_key_from_curve25519_public_key(ed25519_public_key_t *pubkey, + const curve25519_public_key_t *pubkey_in, + int signbit); + #endif #define ED25519_BASE64_LEN 43 -- cgit v1.2.3-54-g00ecf