Module ed25519

Source
Expand description

Ed25519 implementation of the Scheme trait.

This implementation uses the ed25519-consensus crate to adhere to a strict set of validation rules for Ed25519 signatures (which is necessary for stability in a consensus context). You can read more about this here.

§Example

use commonware_cryptography::{Ed25519, Scheme};
use rand::rngs::OsRng;

// Generate a new private key
let mut signer = Ed25519::new(&mut OsRng);

// Create a message to sign
let namespace = Some(&b"demo"[..]);
let msg = b"hello, world!";

// Sign the message
let signature = signer.sign(namespace, msg);

// Verify the signature
assert!(Ed25519::verify(namespace, msg, &signer.public_key(), &signature));

Structs§

Ed25519
Ed25519 Signer.
Ed25519Batch
Ed25519 Batch Verifier.
PrivateKey
Ed25519 Private Key.
PublicKey
Ed25519 Public Key.
Signature
Ed25519 Signature.