Module cryptoxide::curve25519 [−][src]
Expand description
Curve25519 elliptic curve diffie hellman (X25519)
Curve25519 elliptic curve from Specification, and extra information also on Wikipedia
Example
Creating a curve25519 point from a secret:
use cryptoxide::curve25519::curve25519_base;
let secret : [u8;32] = [0,1,2,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
let public = curve25519_base(&secret);
Doing a ECDH on curve25519 using a curve point ‘other_point’ and a specific secret:
use cryptoxide::curve25519::{curve25519_base, curve25519};
let secret : [u8;32] = [0,1,2,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
let public = curve25519(&secret, &other_point);
Functions
Computes a shared secret from the curve25519 private key (n) and public key (p)
Derives a public key from a private key