pub struct ExtraSponge<A: SpongeAPI, I: List> { /* private fields */ }Expand description
This is a slightly extended generic NewType wrapper around the original SpongeAPI. It is decorated with the IOPattern I intended for this sponge instance.
Implementations§
Source§impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>where
Norm<I>: ToIOPattern,
impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>where
Norm<I>: ToIOPattern,
Sourcepub fn start(
domain_separator: Option<u32>,
api: A,
acc: &mut A::Acc,
) -> ExtraSponge<A, Norm<I>>
pub fn start( domain_separator: Option<u32>, api: A, acc: &mut A::Acc, ) -> ExtraSponge<A, Norm<I>>
Creates a sponge with the IOPatten given as a type parameter. Note that we do not require this pattern to be normalized - instead the constructor will return an ExtraSPonge with a normalized pattern.
Source§impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>
impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>
Sourcepub fn absorb<U>(
self,
harray: Array<A::Value, U>,
acc: &mut A::Acc,
) -> ExtraSponge<A, Use<I, Absorb<U>>>
pub fn absorb<U>( self, harray: Array<A::Value, U>, acc: &mut A::Acc, ) -> ExtraSponge<A, Use<I, Absorb<U>>>
This pass-through function is used to absorb elements in the sponge. It calls the underlying API’s absorb function, and then returns a new ExtraSponge but a successful method dispatch to this implementation gaurantees the call is coherent with the IOPattern.
Source§impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>
impl<A: SpongeAPI, I: Normalize> ExtraSponge<A, I>
Sourcepub fn squeeze<U>(
self,
harray: &mut Array<A::Value, U>,
acc: &mut A::Acc,
) -> ExtraSponge<A, Use<I, Squeeze<U>>>
pub fn squeeze<U>( self, harray: &mut Array<A::Value, U>, acc: &mut A::Acc, ) -> ExtraSponge<A, Use<I, Squeeze<U>>>
This pass-through function is used to squeeze elements out of the sponge. It calls the underlying API’s squeeze function, and then returns a new ExtraSponge but a successful method dispatch to this implementation gaurantees the call is coherent with the IOPattern.