fn aead_nonce(&self, position: u32, last_block: bool) -> Result<crate::Nonce<A>> {
        if position > Self::COUNTER_MAX {
            return Err(Error);
        }

        let mut result = GenericArray::default();

        // TODO(tarcieri): use `generic_array::sequence::Concat` (or const generics)
        let (prefix, tail) = result.split_at_mut(NonceSize::<A, Self>::to_usize());
        prefix.copy_from_slice(&self.nonce);

        let position_with_flag = position | ((last_block as u32) << 31);
        tail.copy_from_slice(&position_with_flag.to_le_bytes());

        Ok(result)
    }
/// Compute the full AEAD nonce including the STREAM counter and last
/// block flag.
Compute the full AEAD nonce including the STREAM counter and last
block flag.
Compute the full AEAD nonce including the STREAM counter and last block flag .
fn aead_nonce(&self, position: u32, last_block: bool) -> Result<crate::Nonce<A>> {
        if position > Self::COUNTER_MAX {
            return Err(Error);
        }
        let mut result = GenericArray::default();
        // TODO(tarcieri): use `generic_array::sequence::Concat` (or const generics)
        let (prefix, tail) = result.split_at_mut(NonceSize::<A, Self>::to_usize());
        prefix.copy_from_slice(&self.nonce);
        let position_with_flag = position | ((last_block as u32) << 31);
        tail.copy_from_slice(&position_with_flag.to_le_bytes());
        Ok(result)
    }
fn aead_nonce ( & self , position : u32 , last_block : bool ) -> Result < crate :: Nonce < A > > { if position > Self :: COUNTER_MAX { return Err ( Error ) ; } let mut result = GenericArray :: default ( ) ; // TODO(tarcieri): use `generic_array::sequence::Concat` (or const generics) let ( prefix , tail ) = result . split_at_mut ( NonceSize :: < A , Self > :: to_usize ( ) ) ; prefix . copy_from_slice ( & self . nonce ) ; let position_with_flag = position | ( ( last_block as u32 ) << 31 ) ; tail . copy_from_slice ( & position_with_flag . to_le_bytes ( ) ) ; Ok ( result ) }
Compute the full AEAD nonce including the STREAM counter and last
block flag.
Compute the full AEAD nonce including the STREAM counter and last block flag .
&self
position
u32
last_block
bool
&self
position
u32
last_block
bool