Skip to main content

zaun_community_protocol/
crypto.rs

1//! RFC 10073 composite signatures, suite 1 `id-MLDSA65-Ed25519-SHA512` (specification §2,
2//! §3.2–3.5, ADR-0011).
3//!
4//! ```text
5//! M'       = Prefix ‖ Label ‖ len(ctx) u8 ‖ ctx ‖ SHA-512(M)
6//! mldsaSig = ML-DSA-65.Sign(mldsaSK, M', ctx = Label)      (FIPS 204 pure, hedged)
7//! edSig    = Ed25519.Sign(edSK, M')
8//! ```
9//!
10//! A signature is valid only when **both** components verify (Ed25519 strictly). The `ctx` is
11//! this protocol's domain separation and is always supplied by the verifier ([`Context`]).
12
13mod composite;
14mod context;
15mod error;
16mod hash;
17mod secret;
18pub mod voice;
19
20pub use composite::{LABEL, PREFIX, message_prime, sign, sign_deterministic, verify, verify_raw};
21pub use context::{Context, ContextStatus};
22pub use error::{SignError, VerifyError};
23pub use hash::{Sha3Hasher, community_id, content_hash, host_id, publisher_id};
24pub use secret::{SECRET_KEY_LEN, SecretKey};
25
26#[cfg(test)]
27mod tests;