Expand description
Ed25519 implementation of the crate::Verifier and crate::Signer traits.
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, PrivateKey, PublicKey, Signature, Verifier as _, Signer as _};
use commonware_math::algebra::Random;
use rand::rngs::OsRng;
// Generate a new private key
let mut signer = ed25519::PrivateKey::random(&mut OsRng);
// Create a message to sign
let namespace = &b"demo"[..];
let msg = b"hello, world!";
// Sign the message
let signature = signer.sign(namespace, msg);
// Verify the signature
assert!(signer.public_key().verify(namespace, msg, &signature));Modules§
- certificate
- Ed25519 signing scheme implementation.
Structs§
- Batch
- Ed25519 Batch Verifier.
- Private
Key - Ed25519 Private Key.
- Public
Key - Ed25519 Public Key.
- Signature
- Ed25519 Signature.