fn derive_down(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index_in_tree: NodeIndex,
    ) {
        log::debug!(
            "Deriving tree secret for node {} with {}",
            index_in_tree.as_u32(),
            ciphersuite
        );
        let hash_len = ciphersuite.hash_length();
        let node_secret = &self.nodes[index_in_tree.as_usize()]
            .as_ref()
            .unwrap()
            .secret;
        log_crypto!(trace, "Node secret: {:x?}", node_secret.as_slice());
        let left_index =
            left(index_in_tree).expect("derive_down: Error while computing left child.");
        let right_index = right(index_in_tree, self.size)
            .expect("derive_down: Error while computing right child.");
        let left_secret = derive_tree_secret(
            node_secret,
            "tree",
            left_index.as_u32(),
            0,
            hash_len,
            backend,
        );
        let right_secret = derive_tree_secret(
            node_secret,
            "tree",
            right_index.as_u32(),
            0,
            hash_len,
            backend,
        );
        log_crypto!(
            trace,
            "Left node ({}) secret: {:x?}",
            left_index.as_u32(),
            left_secret.as_slice()
        );
        log_crypto!(
            trace,
            "Right node ({}) secret: {:x?}",
            right_index.as_u32(),
            right_secret.as_slice()
        );
        self.nodes[left_index.as_usize()] = Some(SecretTreeNode {
            secret: left_secret,
        });
        self.nodes[right_index.as_usize()] = Some(SecretTreeNode {
            secret: right_secret,
        });
        self.nodes[index_in_tree.as_usize()] = None;
    }
/// Derives the secrets for the child leaves in a SecretTree and blanks the
/// parent leaf.
Derives the secrets for the child leaves in a SecretTree and blanks the
parent leaf.
Derives the secrets for the child leaves in a SecretTree and blanks the parent leaf .
fn derive_down(
        &mut self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        index_in_tree: NodeIndex,
    ) {
        log::debug!(
            "Deriving tree secret for node {} with {}",
            index_in_tree.as_u32(),
            ciphersuite
        );
        let hash_len = ciphersuite.hash_length();
        let node_secret = &self.nodes[index_in_tree.as_usize()]
            .as_ref()
            .unwrap()
            .secret;
        log_crypto!(trace, "Node secret: {:x?}", node_secret.as_slice());
        let left_index =
            left(index_in_tree).expect("derive_down: Error while computing left child.");
        let right_index = right(index_in_tree, self.size)
            .expect("derive_down: Error while computing right child.");
        let left_secret = derive_tree_secret(
            node_secret,
            "tree",
            left_index.as_u32(),
            0,
            hash_len,
            backend,
        );
        let right_secret = derive_tree_secret(
            node_secret,
            "tree",
            right_index.as_u32(),
            0,
            hash_len,
            backend,
        );
        log_crypto!(
            trace,
            "Left node ({}) secret: {:x?}",
            left_index.as_u32(),
            left_secret.as_slice()
        );
        log_crypto!(
            trace,
            "Right node ({}) secret: {:x?}",
            right_index.as_u32(),
            right_secret.as_slice()
        );
        self.nodes[left_index.as_usize()] = Some(SecretTreeNode {
            secret: left_secret,
        });
        self.nodes[right_index.as_usize()] = Some(SecretTreeNode {
            secret: right_secret,
        });
        self.nodes[index_in_tree.as_usize()] = None;
    }
fn derive_down ( & mut self , ciphersuite : & Ciphersuite , backend : & impl OpenMlsCryptoProvider , index_in_tree : NodeIndex , ) { log :: debug ! ( " " index_in_tree as_u32 ( ) ciphersuite ) ; let hash_len = ciphersuite . hash_length ( ) ; let node_secret = & self . nodes [ index_in_tree . as_usize ( ) ] . as_ref ( ) . unwrap ( ) . secret ; log_crypto ! ( trace " " node_secret as_slice ( ) ) ; let left_index = left ( index_in_tree ) . expect ( " " ) ; let right_index = right ( index_in_tree , self . size ) . expect ( " " ) ; let left_secret = derive_tree_secret ( node_secret , " " , left_index . as_u32 ( ) , 0 , hash_len , backend , ) ; let right_secret = derive_tree_secret ( node_secret , " " , right_index . as_u32 ( ) , 0 , hash_len , backend , ) ; log_crypto ! ( trace " " left_index as_u32 ( ) left_secret as_slice ( ) ) ; log_crypto ! ( trace " " right_index as_u32 ( ) right_secret as_slice ( ) ) ; self . nodes [ left_index . as_usize ( ) ] = Some ( SecretTreeNode { secret : left_secret , } ) ; self . nodes [ right_index . as_usize ( ) ] = Some ( SecretTreeNode { secret : right_secret , } ) ; self . nodes [ index_in_tree . as_usize ( ) ] = None ; }
Derives the secrets for the child leaves in a SecretTree and blanks the
parent leaf.
Derives the secrets for the child leaves in a SecretTree and blanks the parent leaf .
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index_in_tree
NodeIndex
&mut self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
index_in_tree
NodeIndex