I'm using the Curve25519 code (from http://www.dlbeer.co.nz/oss/c25519.html), and trying to convert from a public signing key (Edwards form) to a public key-exchange key (Montgomery form). There's test code that does that, but it seems to extract the Y coordinate from the secret key, and if I had the secret key I wouldn't need to do this.

I'm a software developer, not a mathematician. I don't see how to go from a packed Ed25519 public key to the unpacked X and Y coordinates required for the conversion.

How can I split a packed Ed25519 public signing key into its X and Y coordinates?

I'm asking for the mathematical explanation and/or references to the functions in that package that will split the packed Ed25519 key into X and Y coordinates.

For reference, I've tried the upp function to unpack the public key, and the ed25519_try_unpack function. Both give the same (incorrect) value.

  • $\begingroup$ Why do you care about the second coordinate when you want to convert to a montgomery DH key, which is typically x-only? $\endgroup$ – CodesInChaos Sep 20 '17 at 17:10
  • $\begingroup$ Hello, @CodesInChaos. I've looked at your implementation as well, but couldn't figure out what I needed to do from it. Anyway, the comment on the morph25519_e2m function is "Convert an Edwards Y to a Montgomery X (Edwards X is not used)". $\endgroup$ – Head Geek Sep 20 '17 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.