pub fn update(&mut self, entry: TreeEntry) {
        assert!(
            entry.key > self.current_leaf.full_key,
            "Keys provided to a digest must be monotonically increasing"
        );

        let diverging_level = utils::find_diverging_bit(self.current_leaf.full_key, entry.key) + 1;

        // Hash the current leaf up to the `diverging_level`, taking current `left_contour` into account.
        let mut hash = self
            .hasher
            .hash_leaf(&self.current_leaf.value_hash, self.current_leaf.leaf_index);
        for depth in 0..(TREE_DEPTH - diverging_level) {
            let empty_subtree_hash = self.hasher.empty_subtree_hash(depth);
            // Replace the left contour value with the default one.
            let left_hash = mem::replace(&mut self.left_contour[depth], empty_subtree_hash);

            hash = if self.current_leaf.full_key.bit(depth) {
                self.hasher.hash_branch(&left_hash, &hash)
            } else {
                // We don't take right contour into account, since by construction (because we iterate
                // over keys in ascending order) it's always empty.
                self.hasher.hash_branch(&hash, &empty_subtree_hash)
            };
        }
        // Record the computed hash.
        self.left_contour[TREE_DEPTH - diverging_level] = hash;
        self.current_leaf = LeafNode::new(entry);
    }
Updates this digest with a new entry.

# Panics

Panics if the provided `key` is not greater than the previous key provided to this digest.
core/lib/merkle_tree/src/hasher/proofs.rs