schnorr48
48-byte Schnorr signatures over Ed25519.
Overview
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.
Signature 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
Use Cases
- Bandwidth-constrained networks (LoRa, satellite, mesh)
- Embedded systems with limited packet sizes
- Any application where 16 bytes per signature matters
Example
use ;
// Generate keypair from 32-byte seed
let seed = new;
let = derive_keypair;
// Sign a message
let message = b"hello world";
let signature = sign;
// Verify (returns bool)
assert!;
Security Properties
- Deterministic nonces (RFC 6979 style) — prevents nonce reuse attacks
- Constant-time operations — via
curve25519-dalekandsubtle - Defense-in-depth validation:
- Rejects identity points
- Rejects low-order/torsion points
- Rejects non-canonical scalars (s >= L)
- Rejects zero scalars
- Key zeroization — private keys and seeds are zeroized on drop
no_std Support
This crate is #![no_std] compatible. It requires the alloc crate (for curve25519-dalek).
[]
= { = "0.1", = false }
Security Considerations
The 16-byte truncated challenge provides ~128-bit security against forgery (birthday bound on 128-bit hash). This is equivalent to AES-128 or the collision resistance of SHA-256.
For applications requiring the full 256-bit security margin of Ed25519, use standard 64-byte Ed25519 signatures instead.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.