Struct risc0_zkvm::sha::Digest
source · pub struct Digest(_);
Expand description
Digest represents the results of a hashing function. It is always 256 bits of storage although depending on the hash it may have additional structure (for example Poseidon’s output is actually composed of field elements). The storage is in u32’s in part to simiplify alignment requirements, especially in the zkVM.
Implementations§
source§impl Digest
impl Digest
sourcepub fn as_mut_words(&mut self) -> &mut [u32]
pub fn as_mut_words(&mut self) -> &mut [u32]
Returns a mutable slice of words.
sourcepub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
Returns a mutable slice of bytes.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Digest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Digest, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'zeroio_deserialize> Deserialize<'zeroio_deserialize> for Digest
impl<'zeroio_deserialize> Deserialize<'zeroio_deserialize> for Digest
source§impl Ord for Digest
impl Ord for Digest
source§impl PartialEq<Digest> for Digest
impl PartialEq<Digest> for Digest
source§impl PartialOrd<Digest> for Digest
impl PartialOrd<Digest> for Digest
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Digest
impl Serialize for Digest
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Digest
impl Eq for Digest
impl Pod for Digest
impl StructuralEq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
Blanket Implementations§
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)