File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
twenty-first/src/util_types Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -203,12 +203,15 @@ impl MerkleTree {
203203 Ok ( nodes)
204204 }
205205
206- /// Given a list of leaf indices, return the indices of exactly those nodes that
207- /// are needed to prove (or verify) that the indicated leafs are in the Merkle
208- /// tree.
209- // This function is not defined as a method (taking self as argument) since it's
210- // needed by the verifier, who does not have access to the Merkle tree.
211- fn authentication_structure_node_indices (
206+ /// Compute the node indices for an authentication structure.
207+ ///
208+ /// Given a list of leaf indices, return the indices of exactly those nodes
209+ /// that are needed to prove (or verify) that the indicated leafs are in the
210+ /// Merkle tree.
211+ ///
212+ /// Returns an error if any of the leaf indices is bigger than the number of
213+ /// leafs.
214+ pub fn authentication_structure_node_indices (
212215 num_leafs : MerkleTreeLeafIndex ,
213216 leaf_indices : & [ MerkleTreeLeafIndex ] ,
214217 ) -> Result < impl ExactSizeIterator < Item = MerkleTreeLeafIndex > + use < > > {
You can’t perform that action at this time.
0 commit comments