curve25519-dalek-source/tests
Tony Arcieri c8c9f29989
Add Scalar and MontgomeryPoint conversions (#296)
* Add `Scalar` and `MontgomeryPoint` conversions

- Adds `SigningKey::to_scalar` to extract the private scalar
- Adds `VerifyingKey::to_montgomery` to map the verifying key's
  `EdwardsPoint` to a `MontgomeryPoint`
- Also adds corresponding `From<&T>` impls which call the inherent
  methods.

This is useful for systems which are keyed using Ed25519 keys which
would like to use X25519 for D-H. Having inherent methods means it's
possible to call these methods without having to import `Scalar` and
`MontgomeryPoint` from `curve25519-dalek`.

This is of course a bit circuitous: we could just multiply `Scalar` by
`EdwardsPoint` and use the resulting `EdwardsPoint` as the D-H shared
secret, however it seems many protocols have adopted this approach of
mapping to `MontgomeryPoint` and using that for the shared secret, since
X25519 is traditionally used for ECDH with Curve25519.

* Add reference to eprint 2021/509

* Basic X25519 Diffie-Hellman test
2023-03-30 13:29:36 -04:00
..
examples PKCS#8 support (#224) 2022-12-13 18:19:31 -05:00
ed25519.rs Improve diagnostics when key being deserializing is too long (#294) 2023-03-26 04:11:23 -04:00
pkcs8.rs Rename Keypair => SigningKey; PublicKey => VerifyingKey (#242) 2022-12-18 01:24:58 -05:00
validation_criteria.rs Remove two unnecessary into_iter (#290) 2023-03-18 09:22:15 -06:00
x25519.rs Add Scalar and MontgomeryPoint conversions (#296) 2023-03-30 13:29:36 -04:00