pub(crate) fn validate_public_keys(
        &self,
        public_keys: &[HpkePublicKey],
        path: &[NodeIndex],
    ) -> Result<(), TreeError> {
        if public_keys.len() != path.len() {
            return Err(TreeError::InvalidArguments);
        }
        for (public_key, node_index) in public_keys.iter().zip(path) {
            if let Some(node) = &self.nodes[node_index].node {
                if node.public_key() != public_key {
                    return Err(TreeError::InvalidArguments);
                }
            } else {
                return Err(TreeError::InvalidArguments);
            }
        }
        Ok(())
    }
/// Validates that the `public_keys` matches the public keys in the tree
/// along `path`
Validates that the `public_keys` matches the public keys in the tree
along `path`
Validates that the ` public_keys ` matches the public keys in the tree along ` path `
pub(crate) fn validate_public_keys(
        &self,
        public_keys: &[HpkePublicKey],
        path: &[NodeIndex],
    ) -> Result<(), TreeError> {
        if public_keys.len() != path.len() {
            return Err(TreeError::InvalidArguments);
        }
        for (public_key, node_index) in public_keys.iter().zip(path) {
            if let Some(node) = &self.nodes[node_index].node {
                if node.public_key() != public_key {
                    return Err(TreeError::InvalidArguments);
                }
            } else {
                return Err(TreeError::InvalidArguments);
            }
        }
        Ok(())
    }
pub ( crate ) fn validate_public_keys ( & self , public_keys : & [ HpkePublicKey ] , path : & [ NodeIndex ] , ) -> Result < ( ) , TreeError > { if public_keys . len ( ) != path . len ( ) { return Err ( TreeError :: InvalidArguments ) ; } for ( public_key , node_index ) in public_keys . iter ( ) . zip ( path ) { if let Some ( node ) = & self . nodes [ node_index ] . node { if node . public_key ( ) != public_key { return Err ( TreeError :: InvalidArguments ) ; } } else { return Err ( TreeError :: InvalidArguments ) ; } } Ok ( ( ) ) }
Validates that the `public_keys` matches the public keys in the tree
along `path`
Validates that the ` public_keys ` matches the public keys in the tree along ` path `
&self
public_keys
&[HpkePublicKey]
path
&[NodeIndex]
&self
public_keys
&[HpkePublicKey]
path
&[NodeIndex]