Expand description
Ed25519, a signature scheme.
Ed25519 builds a signature scheme over a curve that is isogenous to curve25519. This module provides the “pure” signature scheme described in https://datatracker.ietf.org/doc/html/rfc8032.
use bssl_crypto::ed25519;
let key = ed25519::PrivateKey::generate();
// Publish your public key.
let public_key_bytes = *key.to_public().as_bytes();
// Sign and publish some message.
let signed_message = b"hello world";
let mut sig = key.sign(signed_message);
// Anyone with the public key can verify it.
let public_key = ed25519::PublicKey::from_bytes(&public_key_bytes);
assert!(public_key.verify(signed_message, &sig).is_ok());Structs§
- Private
Key - An Ed25519 private key.
- Public
Key - An Ed25519 public key used to verify a signature + message.
Constants§
- PUBLIC_
KEY_ LEN - The length in bytes of an Ed25519 public key.
- SEED_
LEN - The length in bytes of an Ed25519 seed which is the 32-byte private key representation defined in RFC 8032.
- SIGNATURE_
LEN - The length in bytes of an Ed25519 signature.
Type Aliases§
- Signature
- An Ed25519 signature created by signing a message with a private key.