Module cryptoxide::curve25519
source · [−]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);
Modules
Scalar functions in \Z/(2^252 + 27742317777372353535851937790883648493)
Structs
Field Element in \Z/(2^255-19)
Curve Group Element (Point)
Curve Group element without t=X*Y
Functions
Computes a shared secret from the curve25519 private key (n) and public key (p)
Derives a public key from a private key