pub struct TupleHash256 { /* private fields */ }Expand description
TupleHash256 implementation
Implementations§
Source§impl TupleHash256
impl TupleHash256
Sourcepub fn new(custom: &[u8]) -> Self
pub fn new(custom: &[u8]) -> Self
Creates a new TupleHash instance with the given customization string
Sourcepub fn update_tuple<T: AsRef<[u8]>>(&mut self, tuple: &[T])
pub fn update_tuple<T: AsRef<[u8]>>(&mut self, tuple: &[T])
Update with a tuple of strings
Sourcepub fn finalize(self, output: &mut [u8]) -> Option<()>
pub fn finalize(self, output: &mut [u8]) -> Option<()>
Finalize with specified output length.
output.len() must not exceed MAX_SP800185_FIXED_OUTPUT_BYTES. For longer
output, use Self::xof.
Returns None if output.len() is greater than
MAX_SP800185_FIXED_OUTPUT_BYTES.
Sourcepub fn finalize_with_length(self, output_len: usize) -> Option<Vec<u8>>
pub fn finalize_with_length(self, output_len: usize) -> Option<Vec<u8>>
Finalize with specified output length and return as Vec.
Returns None if output_len is greater than MAX_SP800185_FIXED_OUTPUT_BYTES.
For longer output, use Self::xof.
Sourcepub fn xof(self) -> TupleHash256Reader
pub fn xof(self) -> TupleHash256Reader
Returns an XOF reader for variable-length output.
SP 800-185 encodes XOF mode with right_encode(0) (output bit length zero) before
squeezing.
This consumes self and finalizes the sponge; you cannot call Self::update or
Self::update_tuple afterward on this value.
Trait Implementations§
Source§impl AlgorithmName for TupleHash256
impl AlgorithmName for TupleHash256
Source§impl BlockSizeUser for TupleHash256
impl BlockSizeUser for TupleHash256
Source§impl BufferKindUser for TupleHash256
impl BufferKindUser for TupleHash256
Source§type BufferKind = Eager
type BufferKind = Eager
Source§impl Clone for TupleHash256
impl Clone for TupleHash256
Source§fn clone(&self) -> TupleHash256
fn clone(&self) -> TupleHash256
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CollisionResistance for TupleHash256
impl CollisionResistance for TupleHash256
Source§impl Debug for TupleHash256
impl Debug for TupleHash256
Source§impl Default for TupleHash256
impl Default for TupleHash256
impl HashMarker for TupleHash256
Source§impl SerializableState for TupleHash256
impl SerializableState for TupleHash256
Source§type SerializedStateSize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>
type SerializedStateSize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>
Source§fn serialize(&self) -> SerializedState<Self>
fn serialize(&self) -> SerializedState<Self>
Source§fn deserialize(
serialized_state: &SerializedState<Self>,
) -> Result<Self, DeserializeStateError>
fn deserialize( serialized_state: &SerializedState<Self>, ) -> Result<Self, DeserializeStateError>
Source§impl Update for TupleHash256
impl Update for TupleHash256
Source§impl UpdateCore for TupleHash256
impl UpdateCore for TupleHash256
Source§fn update_blocks(&mut self, blocks: &[Block<Self>])
fn update_blocks(&mut self, blocks: &[Block<Self>])
impl ZeroizeOnDrop for TupleHash256
zeroize only.Auto Trait Implementations§
impl Freeze for TupleHash256
impl RefUnwindSafe for TupleHash256
impl Send for TupleHash256
impl Sync for TupleHash256
impl Unpin for TupleHash256
impl UnsafeUnpin for TupleHash256
impl UnwindSafe for TupleHash256
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SmallBlockSizeUser for T
impl<T> SmallBlockSizeUser for T
Source§type _BlockSize = <T as BlockSizeUser>::BlockSize
type _BlockSize = <T as BlockSizeUser>::BlockSize
<Self as BlockSizeUser>::BlockSize.