sos-core 0.17.1

Core types for the Save Our Secrets SDK
Documentation
//! Create and compare commits in an underlying merkle tree.
mod proof;
mod tree;

use rs_merkle::{algorithms::Sha256, Hasher};
use serde::{Deserialize, Serialize};

/// Type for an Sha256 commit tree hash.
pub type TreeHash = <Sha256 as Hasher>::Hash;

/// Commit hash of zeroes.
pub const ZERO: TreeHash = [0u8; 32];

pub use proof::{CommitHash, CommitProof, Comparison};
pub use tree::CommitTree;

/// Commit state combines the last commit hash with
/// a commit proof.
#[derive(Default, Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct CommitState(pub CommitHash, pub CommitProof);