Expand description
48-byte Schnorr signatures over Ed25519.
This crate provides bandwidth-efficient Schnorr signatures using a truncated 16-byte challenge instead of the standard 32-byte hash. This saves 16 bytes per signature (48 bytes vs 64 bytes) while maintaining ~128-bit security.
§Format
signature = e (16 bytes) || s (32 bytes)Where:
eis the truncated SHA-512 challenge (first 16 bytes)sis the full 32-byte scalar response
§Example
use schnorr48::{Seed, derive_keypair, sign, verify};
// Generate keypair from seed
let seed = Seed::new([0u8; 32]);
let (privkey, pubkey) = derive_keypair(&seed);
// Sign a message
let message = b"hello world";
let signature = sign(&privkey, &pubkey, message);
// Verify
assert!(verify(&pubkey, message, &signature));§Security
- Deterministic nonces (RFC 6979 style) prevent nonce reuse
- Constant-time scalar operations via
curve25519-dalek - Rejects identity points, low-order points, and non-canonical scalars
- Key material zeroized on drop
§no_std
This crate is #![no_std] compatible. It requires alloc for the
curve25519-dalek dependency.
Structs§
- Private
Key - 32-byte Ed25519 private key (clamped scalar).
- Public
Key - 32-byte Ed25519 public key (compressed point).
- Seed
- 32-byte seed for keypair derivation.
Constants§
- SIGNATURE_
LEN - Length of a Schnorr48 signature in bytes.
Functions§
- derive_
keypair - Derive an Ed25519 keypair from a seed.
- sign
- Sign a message. Returns 48-byte signature
e[16] || s[32]. - verify
- Verify a 48-byte signature. Returns
trueif valid.