argone-signing 0.1.1

Sign Argone packages and verify their trust chain (Ed25519 + BLAKE3).
Documentation
// TODO(logo): restore `#![doc(html_logo_url = ".../argone-symbol.svg")]` once argone.dev serves the symbol at a public image URL.
//! Package signing + two-level trust. Built on ed25519 + blake3.
pub mod chain;
pub mod keys;
pub mod release;

pub use chain::{countersign, verify_chain, Envelope};

/// Package/artifact format version (independently semver'd contract).
pub const FORMAT_VERSION: u32 = 1;

#[derive(Debug, PartialEq, Eq)]
pub enum SigError {
    Json(String),
    BadLength,
    BadSignature,
    UntrustedKey,
    FormatIncompatible { found: u32 },
}
impl std::fmt::Display for SigError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{self:?}")
    }
}
impl std::error::Error for SigError {}

/// blake3(app.wasm ‖ manifest.mpack ‖ release.json) — the signable digest.
pub fn digest(app_wasm: &[u8], manifest_mpack: &[u8], release_json: &[u8]) -> [u8; 32] {
    let mut h = blake3::Hasher::new();
    h.update(app_wasm);
    h.update(manifest_mpack);
    h.update(release_json);
    *h.finalize().as_bytes()
}