public class Treehash
extends java.lang.Object
Constructor and Description |
---|
Treehash(Digest name,
byte[][] statByte,
int[] statInt)
This constructor regenerates a prior treehash object
|
Treehash(java.util.Vector tailStack,
int maxHeight,
Digest digest)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys a treehash instance after the top node was taken for
authentication path.
|
byte[] |
getFirstNode()
returns the first node stored in treehash instance itself
|
int |
getFirstNodeHeight()
Returns the top node height
|
int |
getLowestNodeHeight()
Returns the height of the lowest node stored either in treehash or on the
stack.
|
byte[] |
getSeedActive()
returns the active seed
|
byte[][] |
getStatByte()
Returns the status byte array used by the GMSSPrivateKeyASN.1 class
|
int[] |
getStatInt()
Returns the status int array used by the GMSSPrivateKeyASN.1 class
|
java.util.Vector |
getTailStack()
Returns the tailstack
|
void |
initialize()
initializes the treehash instance.
|
void |
initializeSeed(byte[] seedIn)
Method to initialize the seeds needed for the precomputation of right
nodes.
|
void |
setFirstNode(byte[] hash)
This method sets the first node stored in the treehash instance itself
|
java.lang.String |
toString()
returns a String representation of the treehash instance
|
void |
update(GMSSRandom gmssRandom,
byte[] leaf)
Calculates one update of the treehash instance, i.e. creates a new leaf
and hashes if possible
|
void |
updateNextSeed(GMSSRandom gmssRandom)
updates the nextSeed of this treehash instance one step needed for the
schedulng of the seeds
|
boolean |
wasFinished()
Method to check whether the instance has been finished or not
|
boolean |
wasInitialized()
Method to check whether the instance has been initialized or not
|
public Treehash(Digest name, byte[][] statByte, int[] statInt)
name
- an array of strings, containing the name of the used hash
function and PRNG and the name of the corresponding providerstatByte
- status bytesstatInt
- status intspublic Treehash(java.util.Vector tailStack, int maxHeight, Digest digest)
tailStack
- a vector element where the stack nodes are storedmaxHeight
- maximal height of the treehash instancedigest
- an array of strings, containing the name of the used hash
function and PRNG and the name of the corresponding providerpublic void initializeSeed(byte[] seedIn)
seedIn
- public void initialize()
public void update(GMSSRandom gmssRandom, byte[] leaf)
gmssRandom
- an instance of the PRNGleaf
- The byte value of the leaf needed for the updatepublic void destroy()
public int getLowestNodeHeight()
public int getFirstNodeHeight()
public boolean wasInitialized()
public boolean wasFinished()
public byte[] getFirstNode()
public byte[] getSeedActive()
public void setFirstNode(byte[] hash)
hash
- public void updateNextSeed(GMSSRandom gmssRandom)
gmssRandom
- the prng used for the seedspublic java.util.Vector getTailStack()
public byte[][] getStatByte()
public int[] getStatInt()
public java.lang.String toString()
toString
in class java.lang.Object