@Beta public class MerkleTreeFactory extends Object
Constructor and Description |
---|
MerkleTreeFactory() |
Modifier and Type | Method and Description |
---|---|
static MerkleTree |
build(ProtocolVersion version,
MessageDigest messageDigest,
Map<Integer,String> leaves,
Map<Integer,String> salts)
builds a new instance of Merkle tree
|
static MerkleTree |
buildPartialTree(ProtocolVersion version,
MessageDigest messageDigest,
int numberOfLeaves,
Map<Integer,String> knownLeaves,
Map<Integer,String> knownSalts,
Map<String,String> knownHashes)
Creates a Merkle tree with given parameters.
|
static MerkleTree |
buildPartialTree(String version,
MessageDigest messageDigest,
int numberOfLeaves,
Map<Integer,String> knownLeaves,
Map<Integer,String> knownSalts,
Map<String,String> knownHashes)
Creates a Merkle tree with given parameters.
|
@Nonnull public static MerkleTree build(@Nullable ProtocolVersion version, @Nonnull MessageDigest messageDigest, @Nonnull Map<Integer,String> leaves, @Nonnull Map<Integer,String> salts)
version
- the version, which defines how the MerkleTree will be built Enforce version to make sure the
compatibilitymessageDigest
- messageDigest instance used to calculate the hashleaves
- the leaves of the MerkleTreesalts
- the salts of the MerkleTree@Nonnull public static MerkleTree buildPartialTree(String version, MessageDigest messageDigest, int numberOfLeaves, Map<Integer,String> knownLeaves, Map<Integer,String> knownSalts, Map<String,String> knownHashes)
version
- the version, which defines how the MerkleTree will be built Enforce version to make sure the
compatibilitymessageDigest
- messageDigest instance used to calculate the hashnumberOfLeaves
- the total number of leaves in the MerkleTreeknownLeaves
- the known leaves of the MerkleTreeknownSalts
- the salts of the MerkleTreeknownHashes
- the known hashes of the MerkleTree@Nonnull public static MerkleTree buildPartialTree(@Nullable ProtocolVersion version, @Nonnull MessageDigest messageDigest, int numberOfLeaves, @Nonnull Map<Integer,String> knownLeaves, @Nonnull Map<Integer,String> knownSalts, @Nonnull Map<String,String> knownHashes)
version
- the version, which defines how the MerkleTree will be built Enforce version to make sure the
compatibilitymessageDigest
- messageDigest instance used to calculate the hashnumberOfLeaves
- the total number of leaves in the MerkleTreeknownLeaves
- the known leaves of the MerkleTreeknownSalts
- the known salts of the MerkleTreeknownHashes
- the known hashes of the MerkleTreeCopyright © 2021 SAP SE. All rights reserved.