fn absorb_internal<CS: ConstraintSystem<F>>(&mut self, mut cs: CS, rate_start_index: usize, elements: &[FG]) -> Result<(), SynthesisError>
    {
        // if we can finish in this call
        if rate_start_index + elements.len() <= self.rate 
        {
            for i in 0..elements.len()
            {
                self.state[i + rate_start_index].add_in_place(&mut cs, &elements[i])?;
            }
            self.mode = SpongeState::Absorbing{ next_absorb_index: rate_start_index + elements.len() };
            return Ok(());
        }
        // otherwise absorb (rate - rate_start_index) elements
        let num_elements_absorbed = self.rate - rate_start_index;
        for i in 0..num_elements_absorbed
        {
            self.state[i + rate_start_index].add_in_place(&mut cs, &elements[i])?;
        }
        self.permute(&mut cs)?;
        // Tail recurse, with the input elements being truncated by num elements absorbed
        self.absorb_internal(cs, 0, &elements[num_elements_absorbed..])
    }
// Absorbs everything in elements, this does not end in an absorbtion.
Absorbs everything in elements, this does not end in an absorbtion.
Absorbs everything in elements this does not end in an absorbtion .
fn absorb_internal<CS: ConstraintSystem<F>>(&mut self, mut cs: CS, rate_start_index: usize, elements: &[FG]) -> Result<(), SynthesisError>
    {
        // if we can finish in this call
        if rate_start_index + elements.len() <= self.rate 
        {
            for i in 0..elements.len()
            {
                self.state[i + rate_start_index].add_in_place(&mut cs, &elements[i])?;
            }
            self.mode = SpongeState::Absorbing{ next_absorb_index: rate_start_index + elements.len() };
            return Ok(());
        }
        // otherwise absorb (rate - rate_start_index) elements
        let num_elements_absorbed = self.rate - rate_start_index;
        for i in 0..num_elements_absorbed
        {
            self.state[i + rate_start_index].add_in_place(&mut cs, &elements[i])?;
        }
        self.permute(&mut cs)?;
        // Tail recurse, with the input elements being truncated by num elements absorbed
        self.absorb_internal(cs, 0, &elements[num_elements_absorbed..])
    }
fn absorb_internal < CS : ConstraintSystem < F > > ( & mut self , mut cs : CS , rate_start_index : usize , elements : & [ FG ] ) -> Result < ( ) , SynthesisError > { // if we can finish in this call if rate_start_index + elements . len ( ) <= self . rate { for i in 0 .. elements . len ( ) { self . state [ i + rate_start_index ] . add_in_place ( & mut cs , & elements [ i ] ) ? ; } self . mode = SpongeState :: Absorbing { next_absorb_index : rate_start_index + elements . len ( ) } ; return Ok ( ( ) ) ; } // otherwise absorb (rate - rate_start_index) elements let num_elements_absorbed = self . rate - rate_start_index ; for i in 0 .. num_elements_absorbed { self . state [ i + rate_start_index ] . add_in_place ( & mut cs , & elements [ i ] ) ? ; } self . permute ( & mut cs ) ? ; // Tail recurse, with the input elements being truncated by num elements absorbed self . absorb_internal ( cs , 0 , & elements [ num_elements_absorbed .. ] ) }
Absorbs everything in elements, this does not end in an absorbtion.
Absorbs everything in elements this does not end in an absorbtion .
&mut self
cs
CS
rate_start_index
usize
elements
&[FG]