schnorr48 0.1.0

48-byte Schnorr signatures over Ed25519 (truncated challenge for bandwidth efficiency)
Documentation

schnorr48

48-byte Schnorr signatures over Ed25519.

Crates.io Documentation License

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:

  • e is the truncated SHA-512 challenge (first 16 bytes)
  • s is 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 schnorr48::{Seed, derive_keypair, sign, verify};

// Generate keypair from 32-byte 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 (returns bool)
assert!(verify(&pubkey, message, &signature));

Security Properties

  • Deterministic nonces (RFC 6979 style) — prevents nonce reuse attacks
  • Constant-time operations — via curve25519-dalek and subtle
  • 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).

[dependencies]
schnorr48 = { version = "0.1", default-features = 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:

at your option.