Struct risc0_zkvm::guest::sha::Impl
source · pub struct Impl {}
Expand description
A guest-side Sha implementation.
Trait Implementations§
source§impl Sha for Impl
impl Sha for Impl
source§fn hash_bytes(&self, bytes: &[u8]) -> Self::DigestPtr
fn hash_bytes(&self, bytes: &[u8]) -> Self::DigestPtr
Generate a SHA from a slice of bytes, padding to block size
and adding the SHA trailer.
source§fn hash_raw_words(&self, words: &[u32]) -> Self::DigestPtr
fn hash_raw_words(&self, words: &[u32]) -> Self::DigestPtr
Generate a SHA from a slice of words without adding padding or
length.
source§fn hash_raw_pod_slice<T: Pod>(&self, pod: &[T]) -> Self::DigestPtr
fn hash_raw_pod_slice<T: Pod>(&self, pod: &[T]) -> Self::DigestPtr
Generate a SHA from a slice of anything that can be
represented as plain old data. Pads up to the Sha block
boundry, but does not add the standard SHA trailer.
source§fn mix(&self, pool: &mut Self::DigestPtr, val: &Digest)
fn mix(&self, pool: &mut Self::DigestPtr, val: &Digest)
Generate a new digest by mixing two digests together via XOR,
and storing into the first digest.
source§fn compress(
&self,
state: &Digest,
block_half1: &Digest,
block_half2: &Digest
) -> &'static Digest
fn compress(
&self,
state: &Digest,
block_half1: &Digest,
block_half2: &Digest
) -> &'static Digest
Execute the sha256 “compress” operation. The block is
specified as two half-blocks. Not all implementations provide
this.
source§fn hash_words(&self, words: &[u32]) -> Self::DigestPtr
fn hash_words(&self, words: &[u32]) -> Self::DigestPtr
Generate a SHA from a slice of words, padding to block size
and adding the SHA trailer.