* There's an implementation of multiplicative key blinding so we
can use it for next-gen hidden service descriptors.
+ * There's an implementation of 'convert a curve25519 key to an
+ ed25519 key' so we can do cross-certification with curve25519
+ keys.
+
* `ED25519_FN(ed25519_randombytes_unsafe)` is now static.
* `ed25519-randombytes-custom.h` has the appropriate code to call
int ed25519_donna_blind_public_key(unsigned char *out, const unsigned char *inp,
const unsigned char *param);
+int ed25519_donna_pubkey_from_curve25519_pubkey(unsigned char *out,
+ const unsigned char *inp, int signbit);
+
#endif
* Routines that deal with the private key now use the expanded form.
* Support for multiplicative key blinding has been added.
+
+ * Support for converting a Curve25519 key to an Ed25519 key has been added.
*/
int
return 0;
}
+int
+ed25519_donna_pubkey_from_curve25519_pubkey(unsigned char *out,
+ const unsigned char *inp, int signbit)
+{
+ static const bignum25519 one = { 1 };
+ bignum25519 ALIGN(16) u, uminus1, uplus1, inv_uplus1, y;
+
+ /* Prop228: y = (u-1)/(u+1) */
+ curve25519_expand(u, inp);
+ curve25519_sub(uminus1, u, one);
+ curve25519_add(uplus1, u, one);
+ curve25519_recip(inv_uplus1, uplus1);
+ curve25519_mul(y, uminus1, inv_uplus1);
+ curve25519_contract(out, y);
+
+ /* Propagate sign. */
+ out[31] |= (!!signbit) << 7;
+
+ return 0;
+}
+
#include "test-internals.c"