@@ -26,7 +26,7 @@ const ROOT_MT_INDEX: u64 = 1;
26
26
/// A witness to facilitate the proving of the authenticity of a Merkle
27
27
/// authentication struct.
28
28
#[ derive( Debug , Clone ) ]
29
- pub struct MerkleAuthenticationStructAuthenticityWitness {
29
+ pub struct AuthStructIntegrityProof {
30
30
// All indices are Merkle tree node indices
31
31
pub nd_auth_struct_indices : Vec < u64 > ,
32
32
pub nd_sibling_indices : Vec < ( u64 , u64 ) > ,
@@ -40,10 +40,10 @@ pub struct MerkleAuthenticationStructAuthenticityWitness {
40
40
pub struct AuthenticatedMerkleAuthStruct {
41
41
pub auth_struct : Vec < Digest > ,
42
42
pub indexed_leafs : Vec < ( u64 , Digest ) > ,
43
- pub witness : MerkleAuthenticationStructAuthenticityWitness ,
43
+ pub witness : AuthStructIntegrityProof ,
44
44
}
45
45
46
- impl MerkleAuthenticationStructAuthenticityWitness {
46
+ impl AuthStructIntegrityProof {
47
47
/// Return the Merkle tree node indices of the digests required to prove
48
48
/// membership for the specified leaf indices, as well as the node indices
49
49
/// that can be derived from the leaf indices and their authentication
@@ -398,10 +398,7 @@ mod tests {
398
398
. collect_vec ( ) ;
399
399
400
400
let authenticated_auth_structs =
401
- MerkleAuthenticationStructAuthenticityWitness :: new_from_mmr_membership_proofs (
402
- & mmra,
403
- indexed_mmr_mps,
404
- ) ;
401
+ AuthStructIntegrityProof :: new_from_mmr_membership_proofs ( & mmra, indexed_mmr_mps) ;
405
402
406
403
let peak_heights = get_peak_heights ( mmr_leaf_count) ;
407
404
for ( peak_index, authentication_auth_struct) in authenticated_auth_structs {
@@ -437,10 +434,7 @@ mod tests {
437
434
. collect_vec ( ) ;
438
435
439
436
let authenticity_witnesses =
440
- MerkleAuthenticationStructAuthenticityWitness :: new_from_mmr_membership_proofs (
441
- & mmra,
442
- indexed_mmr_mps,
443
- ) ;
437
+ AuthStructIntegrityProof :: new_from_mmr_membership_proofs ( & mmra, indexed_mmr_mps) ;
444
438
assert ! (
445
439
authenticity_witnesses. len( ) . is_one( ) ,
446
440
"All indices belong to first peak"
@@ -479,10 +473,7 @@ mod tests {
479
473
. collect_vec ( ) ;
480
474
481
475
let authenticity_witnesses =
482
- MerkleAuthenticationStructAuthenticityWitness :: new_from_mmr_membership_proofs (
483
- & mmra,
484
- indexed_mmr_mps,
485
- ) ;
476
+ AuthStructIntegrityProof :: new_from_mmr_membership_proofs ( & mmra, indexed_mmr_mps) ;
486
477
assert ! (
487
478
authenticity_witnesses. len( ) . is_one( ) ,
488
479
"All indices belong to first peak"
@@ -518,10 +509,7 @@ mod tests {
518
509
let tree = MerkleTree :: < Tip5 > :: new :: < CpuParallel > ( & leafs) . unwrap ( ) ;
519
510
520
511
let authenticated_auth_struct =
521
- MerkleAuthenticationStructAuthenticityWitness :: new_from_merkle_tree (
522
- & tree,
523
- revealed_leaf_indices,
524
- ) ;
512
+ AuthStructIntegrityProof :: new_from_merkle_tree ( & tree, revealed_leaf_indices) ;
525
513
let AuthenticatedMerkleAuthStruct {
526
514
auth_struct,
527
515
indexed_leafs,
@@ -566,7 +554,7 @@ mod tests {
566
554
} )
567
555
. collect_vec ( ) ;
568
556
569
- let mmr_auth_struct = MerkleAuthenticationStructAuthenticityWitness {
557
+ let mmr_auth_struct = AuthStructIntegrityProof {
570
558
nd_auth_struct_indices,
571
559
nd_sibling_indices,
572
560
nd_siblings,
0 commit comments