Module curve25519

Module 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);

Re-exports§

pub use scalar::Scalar;

Modules§

scalar
Scalar functions in ℤ/(2^252 + 27742317777372353535851937790883648493)

Structs§

Fe
Field Element in ℤ/(2^255-19)
Ge
Curve Group Element (Point)
GeCached
GeP1P1
GePartial
Curve Group element without t=X*Y
GePrecomp

Functions§

curve25519
Computes a shared secret from the curve25519 private key (n) and public key (p)
curve25519_base
Derives a public key from a private key