vouch-core 4.2.0

Vouch Protocol canonical core: JCS canonicalization, Ed25519 + ML-DSA proofs, did:key/multikey, Data Integrity (eddsa-jcs-2022), credentials, delegation, revocation. One byte-exact implementation shared by every language SDK via WASM and UniFFI/C-FFI.
Documentation
//! Vouch Protocol canonical core.
//!
//! One byte-exact Rust implementation of the protocol primitives (JCS
//! canonicalization, Ed25519 and ML-DSA proofs, did:key/multikey, Data Integrity
//! eddsa-jcs-2022, credentials, delegation, revocation), shared by every language
//! SDK through WASM and UniFFI/C-FFI so that no primitive is re-derived per
//! language. Behavior MUST match the TypeScript reference SDK byte-for-byte and
//! pass the shared interop vectors in `test-vectors/`.
//!
//! With the default `std` feature this is the full core. Built with
//! `--no-default-features --features alloc` it is `no_std` (it needs only a
//! heap), for microcontrollers: see `docs/microcontrollers.md` for what that
//! build covers.

#![cfg_attr(not(any(feature = "std", test)), no_std)]

#[cfg(not(any(feature = "std", feature = "alloc")))]
compile_error!("vouch-core needs the `std` feature (default) or the `alloc` feature");

#[cfg(not(any(feature = "std", test)))]
#[macro_use]
extern crate alloc;
#[cfg(any(feature = "std", test))]
extern crate alloc;

/// The heap types that `std` puts in scope by default, imported explicitly so
/// the same source builds with and without `std`.
#[allow(unused_imports)]
pub(crate) mod prelude {
    pub use alloc::borrow::ToOwned;
    pub use alloc::boxed::Box;
    pub use alloc::string::{String, ToString};
    pub use alloc::vec::Vec;
}

/// The set and map types in the public API. With `std` they are the standard
/// hash collections. Without `std` there is no hasher seeded from the OS, so
/// they are the ordered B-tree collections, which have the same methods for
/// everything the core does with them.
pub mod collections {
    #[cfg(feature = "std")]
    pub use std::collections::{HashMap, HashSet};

    #[cfg(not(feature = "std"))]
    pub use alloc::collections::{BTreeMap as HashMap, BTreeSet as HashSet};
}

pub mod attenuation;
pub mod authority_state;
pub mod credentials;
pub mod data_integrity;
pub mod decision;
pub mod delegation;
pub mod did_document;
pub mod did_web;
pub mod did_webvh;
pub mod error;
pub mod fleet;
mod float;
pub mod grant_chain;
pub mod hybrid;
pub mod issuance;
pub mod jcs;
pub mod keys;
pub mod lineage;
pub mod mldsa_check;
pub mod multikey;
pub mod nesting;
pub mod pq;
pub mod proof_json;
mod py_printable;
mod random;
pub mod reasoning;
pub mod reasoning_json;
#[cfg(feature = "std")]
pub mod recovery;
#[cfg(feature = "std")]
pub mod recovery_json;
pub mod robotics;
pub mod robotics_call;
pub mod robotics_domain;
pub mod robotics_dtn;
pub mod robotics_json;
pub mod robotics_prepare;
pub mod robotics_segment;
pub mod robotics_verify;
pub mod root_of_trust;
pub mod session_voucher;
pub mod slh;
pub mod status_list;
#[cfg(feature = "std")]
pub mod threshold;
#[cfg(feature = "std")]
pub mod threshold_json;
pub mod time;
pub mod time_json;
pub mod zdeflate;

pub use error::{CoreError, Result};

/// The serde_json this core is built with. Callers build the `Value`s they
/// pass in with it, so a `no_std` build gets the same serde_json features.
pub use serde_json;