Interface MerkleTreeHashDigestProvider
-
- All Implemented Interfaces:
-
net.corda.v5.crypto.merkle.MerkleTreeHashDigest
public interface MerkleTreeHashDigestProvider implements MerkleTreeHashDigest
Different use cases require different MerkleTree calculations. MerkleTreeHashDigestProviders let us specify the following:
- Leaf Nonce
- Leaf Hash
- Node Hash calculation methods
- Base Digest Algorithm
-
-
Method Summary
Modifier and Type Method Description abstract Array<byte>
leafNonce(int index)
Calculates the nonce for a leaf. abstract SecureHash
leafHash(int index, @Nullable() Array<byte> nonce, @NotNull() Array<byte> bytes)
Calculates the hash of a leaf. abstract SecureHash
nodeHash(int depth, @NotNull() SecureHash left, @NotNull() SecureHash right)
Calculates the hash of a node. -
-
Method Detail
-
leafNonce
@Nullable() abstract Array<byte> leafNonce(int index)
Calculates the nonce for a leaf.
- Parameters:
index
- The leaf's index.
-
leafHash
@NotNull() abstract SecureHash leafHash(int index, @Nullable() Array<byte> nonce, @NotNull() Array<byte> bytes)
Calculates the hash of a leaf.
- Parameters:
index
- The leaf's index.nonce
- The leaf's nonce.bytes
- The leaf's content bytes.
-
nodeHash
@NotNull() abstract SecureHash nodeHash(int depth, @NotNull() SecureHash left, @NotNull() SecureHash right)
Calculates the hash of a node.
- Parameters:
depth
- Depth of the node.left
- SecureHash of the left child of the node.right
- SecureHash of the right child of the node.
-
-
-
-