Module cryptoxide::ed25519

source ·
Expand description

ED25519 Signature Scheme

Examples

Creating a signature, and verifying the signature:

use cryptoxide::ed25519;

let message = "messages".as_bytes();
let secret_key = [0u8;32]; // private key only for example !
let (keypair, public) = ed25519::keypair(&secret_key);
let signature = ed25519::signature(message, &keypair);
let verified = ed25519::verify(message, &public, &signature);
assert!(verified);

The signature is 64 bytes composed of R || S where R is 32 bytes and S is 32 bytes also.

Constants

Functions

Curve25519 DH (Diffie Hellman) between a curve25519 public key and a ED25519 keypair key
generate the public key associated with an extended secret key
keypair of secret key and public key
Extract the private key of a keypair
Extract the public key of a keypair
Generate a signature for the given message using a normal ED25519 secret key
Generate a signature for the given message using an extended ED25519 secret key
Verify that a signature is valid for a given message for an associated public key