Trait Digestible

Source
pub trait Digestible {
    // Required method
    fn hashable_bytes(&self) -> Vec<Box<dyn AsRef<[u8]> + '_>>;

    // Provided methods
    fn digest(&self) -> CoreWrapper<Sha3_512Core> { ... }
    fn finalized_digest(&self) -> [u8; 64] { ... }
}
Expand description

Convert data structures to SHA3-512 digests.

This trait provides a standardized way to convert any data structure into a cryptographic digest suitable for signing or verification operations.

Required Methods§

Source

fn hashable_bytes(&self) -> Vec<Box<dyn AsRef<[u8]> + '_>>

Return a vector of byte references that represent this data structure.

The returned bytes will be hashed in order to create the digest.

Provided Methods§

Source

fn digest(&self) -> CoreWrapper<Sha3_512Core>

Generate a SHA3-512 digest from the hashable bytes.

Source

fn finalized_digest(&self) -> [u8; 64]

Generate a finalized SHA3-512 digest as a 64-byte array.

Implementations on Foreign Types§

Source§

impl Digestible for &str

Source§

fn hashable_bytes(&self) -> Vec<Box<dyn AsRef<[u8]> + '_>>

Source§

impl<T> Digestible for [T]
where T: Digestible,

Source§

fn hashable_bytes(&self) -> Vec<Box<dyn AsRef<[u8]> + '_>>

Implementors§