Top Description Fields Constructors Methods
org.bouncycastle.tsp.ers

public Class BinaryTreeRootCalculator

extends Object
implements ERSRootNodeCalculator
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tsp.ers.ERSRootNodeCalculator
Imports
java.util.ArrayList, .List, org.bouncycastle.asn1.tsp.PartialHashtree, org.bouncycastle.operator.DigestCalculator, org.bouncycastle.util.Arrays

Calculator based on the use of a left weighted binary Merkle tree created on top of the partial hash tree objects provided.

Field Summary

Modifier and TypeField and Description
private List<List<byte[]>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PartialHashtree[]
computePathToRoot(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree
the leaf node at the start of the path.
node
,
int
the index of the node in the original list of partial hash trees.
index
)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computePathToRoot.

Calculate a path from the leaf node to the root of the last computed Merkle tree.

public byte[]
computeRootHash(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree[]
the partial hash-trees forming the basis of the Merkle tree.
nodes
)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computeRootHash.

Calculate the root hash of the Merkle tree from the partial hash-tree nodes.

public byte[]
recoverRootHash(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree[]
the partial hash-trees forming a path from a leaf to the root of the Merkle tree.
nodes
)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.recoverRootHash.

Recover the root hash from a path made up of PartialHashtrees.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

treeback to summary
private List<List<byte[]>> tree

Constructor Detail

BinaryTreeRootCalculatorback to summary
public BinaryTreeRootCalculator()

Method Detail

computePathToRootback to summary
public PartialHashtree[] computePathToRoot(DigestCalculator digCalc, PartialHashtree node, int index)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computePathToRoot.

Doc from org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computePathToRoot.

Calculate a path from the leaf node to the root of the last computed Merkle tree.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

node:PartialHashtree

the leaf node at the start of the path.

index:int

the index of the node in the original list of partial hash trees.

computeRootHashback to summary
public byte[] computeRootHash(DigestCalculator digCalc, PartialHashtree[] nodes)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computeRootHash.

Doc from org.bouncycastle.tsp.ers.ERSRootNodeCalculator.computeRootHash.

Calculate the root hash of the Merkle tree from the partial hash-tree nodes.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

nodes:PartialHashtree[]

the partial hash-trees forming the basis of the Merkle tree.

Returns:byte[]

the root hash of the Merkle tree.

recoverRootHashback to summary
public byte[] recoverRootHash(DigestCalculator digCalc, PartialHashtree[] nodes)

Implements org.bouncycastle.tsp.ers.ERSRootNodeCalculator.recoverRootHash.

Doc from org.bouncycastle.tsp.ers.ERSRootNodeCalculator.recoverRootHash.

Recover the root hash from a path made up of PartialHashtrees.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

nodes:PartialHashtree[]

the partial hash-trees forming a path from a leaf to the root of the Merkle tree.

Returns:byte[]

the root hash of the Merkle tree.