de.flexiprovider.pqc.hbc.cmss
Class Treehash

java.lang.Object
  |
  +--de.flexiprovider.pqc.hbc.cmss.Treehash

class Treehash
extends java.lang.Object


Constructor Summary
Treehash(Stack stack, codec.asn1.ASN1Sequence treehashData)
           
Treehash(Stack stack, int targetHeight)
           
 
Method Summary
 void copy(Treehash otherTreehash)
           
 codec.asn1.ASN1Sequence getASN1()
          Return the data to encode the treehash instance in SubjectPublicKeyInfo structure.
 int getHeight()
           
 Node getNode()
           
 void initialize(byte[] seed)
           
 void storeNode(Node newNode)
           
 java.lang.String toString()
           
 void update(PRNG prng, OTS ots, MessageDigest md, NodeCalc pc)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Treehash

public Treehash(Stack stack,
                codec.asn1.ASN1Sequence treehashData)

Treehash

public Treehash(Stack stack,
                int targetHeight)
Method Detail

initialize

public void initialize(byte[] seed)

update

public void update(PRNG prng,
                   OTS ots,
                   MessageDigest md,
                   NodeCalc pc)

storeNode

public void storeNode(Node newNode)

getNode

public Node getNode()

getHeight

public int getHeight()

copy

public void copy(Treehash otherTreehash)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of the treehash instance

getASN1

public codec.asn1.ASN1Sequence getASN1()
Return the data to encode the treehash instance in SubjectPublicKeyInfo structure.

The ASN.1 definition of treehash

    TREEHASH ::= SEQUENCE {
      node                          NODE                        -- node stored by this instance
      seed                          OCTET STRING                -- seed to compute next leaf
      currentHeight                 INTEGER                     -- height of lowest tailnode stored by this instance
      targetHeight                  INTEGER                     -- height of authentication node computed by this instance
      nodesOnStack                  INTEGER                     -- number of nodes stored on stack by this instance
    }
 
    NODE ::= SEQUENCE {
      value                         OCTET STRING                -- node value
      height                        INTEGER                     -- height of node in tree
    }
    
 
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure