pub(crate) fn secret_for_encryption(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index: LeafIndex,
        secret_type: SecretType,
    ) -> Result<(u32, RatchetSecrets), SecretTreeError> {
        if self.ratchet_opt(index, secret_type)?.is_none() {
            self.initialize_sender_ratchets(ciphersuite, backend, index)
                .expect("Index out of bounds");
        }
        let sender_ratchet = self.ratchet_mut(index, secret_type);
        Ok(sender_ratchet.secret_for_encryption(ciphersuite, backend))
    }
/// Return the next RatchetSecrets that should be used for encryption and
/// then increments the generation.
Return the next RatchetSecrets that should be used for encryption and
then increments the generation.
Return the next RatchetSecrets that should be used for encryption and then increments the generation .
pub(crate) fn secret_for_encryption(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index: LeafIndex,
        secret_type: SecretType,
    ) -> Result<(u32, RatchetSecrets), SecretTreeError> {
        if self.ratchet_opt(index, secret_type)?.is_none() {
            self.initialize_sender_ratchets(ciphersuite, backend, index)
                .expect("Index out of bounds");
        }
        let sender_ratchet = self.ratchet_mut(index, secret_type);
        Ok(sender_ratchet.secret_for_encryption(ciphersuite, backend))
    }
pub ( crate ) fn secret_for_encryption ( & mut self , ciphersuite : & Ciphersuite , backend : & impl OpenMlsCryptoProvider , index : LeafIndex , secret_type : SecretType , ) -> Result < ( u32 , RatchetSecrets ) , SecretTreeError > { if self . ratchet_opt ( index , secret_type ) ? . is_none ( ) { self . initialize_sender_ratchets ( ciphersuite , backend , index ) . expect ( " " ) ; } let sender_ratchet = self . ratchet_mut ( index , secret_type ) ; Ok ( sender_ratchet . secret_for_encryption ( ciphersuite , backend ) ) }
Return the next RatchetSecrets that should be used for encryption and
then increments the generation.
Return the next RatchetSecrets that should be used for encryption and then increments the generation .
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index
LeafIndex
secret_type
SecretType
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index
LeafIndex
secret_type
SecretType