pub struct TupleHash128 { /* private fields */ }Expand description
TupleHash128 implementation
Implementations§
Source§impl TupleHash128
impl TupleHash128
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) -> TupleHash128Reader
pub fn xof(self) -> TupleHash128Reader
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 TupleHash128
impl AlgorithmName for TupleHash128
Source§impl BlockSizeUser for TupleHash128
impl BlockSizeUser for TupleHash128
Source§impl BufferKindUser for TupleHash128
impl BufferKindUser for TupleHash128
Source§type BufferKind = Eager
type BufferKind = Eager
Source§impl Clone for TupleHash128
impl Clone for TupleHash128
Source§fn clone(&self) -> TupleHash128
fn clone(&self) -> TupleHash128
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 TupleHash128
impl CollisionResistance for TupleHash128
Source§impl Debug for TupleHash128
impl Debug for TupleHash128
Source§impl Default for TupleHash128
impl Default for TupleHash128
impl HashMarker for TupleHash128
Source§impl SerializableState for TupleHash128
impl SerializableState for TupleHash128
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 TupleHash128
impl Update for TupleHash128
Source§impl UpdateCore for TupleHash128
impl UpdateCore for TupleHash128
Source§fn update_blocks(&mut self, blocks: &[Block<Self>])
fn update_blocks(&mut self, blocks: &[Block<Self>])
impl ZeroizeOnDrop for TupleHash128
zeroize only.Auto Trait Implementations§
impl Freeze for TupleHash128
impl RefUnwindSafe for TupleHash128
impl Send for TupleHash128
impl Sync for TupleHash128
impl Unpin for TupleHash128
impl UnsafeUnpin for TupleHash128
impl UnwindSafe for TupleHash128
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.