Skip to main content

Module ed25519

Module ed25519 

Source
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§

PrivateKey
An Ed25519 private key.
PublicKey
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.