pub(crate) fn secret_for_decryption(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index: LeafIndex,
        secret_type: SecretType,
        generation: u32,
    ) -> Result<RatchetSecrets, SecretTreeError> {
        log::debug!(
            "Generating {:?} decryption secret for {:?} in generation {} with {}",
            secret_type,
            index,
            generation,
            ciphersuite,
        );
        // Check tree bounds
        if index >= self.size {
            return Err(SecretTreeError::IndexOutOfBounds);
        }
        if self.ratchet_opt(index, secret_type)?.is_none() {
            self.initialize_sender_ratchets(ciphersuite, backend, index)?;
        }
        let sender_ratchet = self.ratchet_mut(index, secret_type);
        sender_ratchet.secret_for_decryption(ciphersuite, backend, generation)
    }
/// Return RatchetSecrets for a given index and generation. This should be
/// called when decrypting an MlsCiphertext received from another member.
/// Returns an error if index or generation are out of bound.
Return RatchetSecrets for a given index and generation. This should be
called when decrypting an MlsCiphertext received from another member.
Returns an error if index or generation are out of bound.
Return RatchetSecrets for a given index and generation . This should be called when decrypting an MlsCiphertext received from another member . Returns an error if index or generation are out of bound .
pub(crate) fn secret_for_decryption(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index: LeafIndex,
        secret_type: SecretType,
        generation: u32,
    ) -> Result<RatchetSecrets, SecretTreeError> {
        log::debug!(
            "Generating {:?} decryption secret for {:?} in generation {} with {}",
            secret_type,
            index,
            generation,
            ciphersuite,
        );
        // Check tree bounds
        if index >= self.size {
            return Err(SecretTreeError::IndexOutOfBounds);
        }
        if self.ratchet_opt(index, secret_type)?.is_none() {
            self.initialize_sender_ratchets(ciphersuite, backend, index)?;
        }
        let sender_ratchet = self.ratchet_mut(index, secret_type);
        sender_ratchet.secret_for_decryption(ciphersuite, backend, generation)
    }
pub ( crate ) fn secret_for_decryption ( & mut self , ciphersuite : & Ciphersuite , backend : & impl OpenMlsCryptoProvider , index : LeafIndex , secret_type : SecretType , generation : u32 , ) -> Result < RatchetSecrets , SecretTreeError > { log :: debug ! ( " " secret_type index generation ciphersuite ) ; // Check tree bounds if index >= self . size { return Err ( SecretTreeError :: IndexOutOfBounds ) ; } if self . ratchet_opt ( index , secret_type ) ? . is_none ( ) { self . initialize_sender_ratchets ( ciphersuite , backend , index ) ? ; } let sender_ratchet = self . ratchet_mut ( index , secret_type ) ; sender_ratchet . secret_for_decryption ( ciphersuite , backend , generation ) }
Return RatchetSecrets for a given index and generation.
Return RatchetSecrets for a given index and generation .
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index
LeafIndex
secret_type
SecretType
generation
u32
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index
LeafIndex
secret_type
SecretType
generation
u32