pub(crate) fn add_context(
        &mut self,
        backend: &impl OpenMlsCryptoProvider,
        group_context: &GroupContext,
    ) -> Result<(), KeyScheduleError> {
        log::trace!("Adding context to key schedule. {:?}", group_context);
        if self.state != State::Initial || self.intermediate_secret.is_none() {
            log::error!(
                "Trying to add context to the key schedule while not in the initial state."
            );
            return Err(KeyScheduleError::InvalidState(ErrorState::NotInit));
        }
        self.state = State::Context;
        log_crypto!(
            trace,
            "  intermediate_secret: {:x?}",
            self.intermediate_secret.as_ref().unwrap().secret.as_slice()
        );

        self.epoch_secret = Some(EpochSecret::new(
            self.ciphersuite,
            backend,
            self.intermediate_secret.take().unwrap(),
            group_context,
        ));
        self.intermediate_secret = None;
        Ok(())
    }
/// Add the group context to the key schedule.
Add the group context to the key schedule.
Add the group context to the key schedule .
pub(crate) fn add_context(
        &mut self,
        backend: &impl OpenMlsCryptoProvider,
        group_context: &GroupContext,
    ) -> Result<(), KeyScheduleError> {
        log::trace!("Adding context to key schedule. {:?}", group_context);
        if self.state != State::Initial || self.intermediate_secret.is_none() {
            log::error!(
                "Trying to add context to the key schedule while not in the initial state."
            );
            return Err(KeyScheduleError::InvalidState(ErrorState::NotInit));
        }
        self.state = State::Context;
        log_crypto!(
            trace,
            "  intermediate_secret: {:x?}",
            self.intermediate_secret.as_ref().unwrap().secret.as_slice()
        );
        self.epoch_secret = Some(EpochSecret::new(
            self.ciphersuite,
            backend,
            self.intermediate_secret.take().unwrap(),
            group_context,
        ));
        self.intermediate_secret = None;
        Ok(())
    }
pub ( crate ) fn add_context ( & mut self , backend : & impl OpenMlsCryptoProvider , group_context : & GroupContext , ) -> Result < ( ) , KeyScheduleError > { log :: trace ! ( " " group_context ) ; if self . state != State :: Initial || self . intermediate_secret . is_none ( ) { log :: error ! ( " " ) ; return Err ( KeyScheduleError :: InvalidState ( ErrorState :: NotInit ) ) ; } self . state = State :: Context ; log_crypto ! ( trace " " self intermediate_secret as_ref ( ) unwrap ( ) secret as_slice ( ) ) ; self . epoch_secret = Some ( EpochSecret :: new ( self . ciphersuite , backend , self . intermediate_secret . take ( ) . unwrap ( ) , group_context , ) ) ; self . intermediate_secret = None ; Ok ( ( ) ) }
Add the group context to the key schedule.
Add the group context to the key schedule .
&mut self
backend
&impl OpenMlsCryptoProvider
group_context
&GroupContext
&mut self
backend
&impl OpenMlsCryptoProvider
group_context
&GroupContext