de.flexiprovider.pqc.hbc.gmss
Class GMSSPrivateKey

java.lang.Object
  |
  +--de.flexiprovider.api.keys.PrivateKey
        |
        +--de.flexiprovider.pqc.hbc.gmss.GMSSPrivateKey
All Implemented Interfaces:
java.security.Key, Key, java.security.PrivateKey, java.io.Serializable

public class GMSSPrivateKey
extends PrivateKey

This class implements a GMSS private key and is usually initiated by the GMSSKeyPairGenerator.

Author:
Michael Schneider, Sebastian Blume
See Also:
GMSSKeyPairGenerator, GMSSPrivateKeySpec, GMSSPrivateKeyASN1, Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Fields inherited from interface java.security.PrivateKey
serialVersionUID
 
Constructor Summary
protected GMSSPrivateKey(byte[][] currentSeed, byte[][] nextNextSeed, byte[][][] currentAuthPath, byte[][][] nextAuthPath, Treehash[][] currentTreehash, Treehash[][] nextTreehash, java.util.Vector[] currentStack, java.util.Vector[] nextStack, java.util.Vector[][] currentRetain, java.util.Vector[][] nextRetain, byte[][] nextRoot, byte[][] currentRootSig, GMSSParameterset gmssParameterset, java.lang.String[] algNames)
          Generates a new GMSS private key
protected GMSSPrivateKey(GMSSPrivateKeySpec gmssPrivKeySpec)
          Constructor
protected GMSSPrivateKey(int[] index, byte[][] currentSeeds, byte[][] nextNextSeeds, byte[][][] currentAuthPaths, byte[][][] nextAuthPaths, byte[][][] keep, Treehash[][] currentTreehash, Treehash[][] nextTreehash, java.util.Vector[] currentStack, java.util.Vector[] nextStack, java.util.Vector[][] currentRetain, java.util.Vector[][] nextRetain, GMSSLeaf[] nextNextLeaf, GMSSLeaf[] upperLeaf, GMSSLeaf[] upperTreehashLeaf, int[] minTreehash, byte[][] nextRoot, GMSSRootCalc[] nextNextRoot, byte[][] currentRootSig, GMSSRootSig[] nextRootSig, GMSSParameterset gmssParameterset, java.lang.String[] algNames)
          Generates a new GMSS private key
 
Method Summary
 java.lang.String getAlgorithm()
           
protected  codec.asn1.ASN1Type getAlgParams()
           
protected  byte[][][] getCurrentAuthPaths()
           
protected  java.util.Vector[][] getCurrentRetain()
           
protected  byte[][] getCurrentRootSig()
           
protected  byte[][] getCurrentSeeds()
           
protected  java.util.Vector[] getCurrentStack()
           
protected  Treehash[][] getCurrentTreehash()
           
protected  int[] getIndex()
           
protected  int getIndex(int i)
           
protected  byte[][][] getKeep()
           
protected  byte[] getKeyData()
           
protected  int[] getMinTreehash()
           
 java.lang.String[] getName()
           
protected  byte[][][] getNextAuthPaths()
           
protected  GMSSLeaf[] getNextNextLeaf()
           
protected  GMSSRootCalc[] getNextNextRoot()
           
protected  byte[][] getNextNextSeeds()
           
protected  java.util.Vector[][] getNextRetain()
           
protected  byte[][] getNextRoot()
           
protected  GMSSRootSig[] getNextRootSig()
           
protected  java.util.Vector[] getNextStack()
           
protected  Treehash[][] getNextTreehash()
           
protected  int[] getNumLeafs()
           
protected  int getNumLeafs(int i)
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
protected  GMSSParameterset getParameterset()
           
protected  byte[] getSubtreeRootSig(int i)
           
protected  GMSSLeaf[] getUpperLeaf()
           
protected  GMSSLeaf[] getUpperTreehashLeaf()
           
 void nextKey(int layer)
          This method updates the GMSS private key for the next signature
 java.lang.String toString()
           
 
Methods inherited from class de.flexiprovider.api.keys.PrivateKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GMSSPrivateKey

protected GMSSPrivateKey(byte[][] currentSeed,
                         byte[][] nextNextSeed,
                         byte[][][] currentAuthPath,
                         byte[][][] nextAuthPath,
                         Treehash[][] currentTreehash,
                         Treehash[][] nextTreehash,
                         java.util.Vector[] currentStack,
                         java.util.Vector[] nextStack,
                         java.util.Vector[][] currentRetain,
                         java.util.Vector[][] nextRetain,
                         byte[][] nextRoot,
                         byte[][] currentRootSig,
                         GMSSParameterset gmssParameterset,
                         java.lang.String[] algNames)
Generates a new GMSS private key
Parameters:
currentSeed - seed for the generation of private OTS keys for the current subtrees
nextNextSeed - seed for the generation of private OTS keys for the next subtrees
currentAuthPath - array of current authentication paths
nextAuthPath - array of next authentication paths
currentTreehash - array of current treehash instances
nextTreehash - array of next treehash instances
currentStack - array of current shared stacks
nextStack - array of next shared stacks
currentRetain - array of current retain stacks
nextRetain - array of next retain stacks
nextRoot - the roots of the next subtree
currentRootSig - array of signatures of the roots of the current subtrees
gmssParameterset - the GMSS Parameterset
algNames - An array of strings, containing the name of the used hash function and the name of the corresponding provider
See Also:
GMSSKeyPairGenerator

GMSSPrivateKey

protected GMSSPrivateKey(GMSSPrivateKeySpec gmssPrivKeySpec)
Constructor
Parameters:
gmssPrivKeySpec - a valid GMSS privateKeySpec

GMSSPrivateKey

protected GMSSPrivateKey(int[] index,
                         byte[][] currentSeeds,
                         byte[][] nextNextSeeds,
                         byte[][][] currentAuthPaths,
                         byte[][][] nextAuthPaths,
                         byte[][][] keep,
                         Treehash[][] currentTreehash,
                         Treehash[][] nextTreehash,
                         java.util.Vector[] currentStack,
                         java.util.Vector[] nextStack,
                         java.util.Vector[][] currentRetain,
                         java.util.Vector[][] nextRetain,
                         GMSSLeaf[] nextNextLeaf,
                         GMSSLeaf[] upperLeaf,
                         GMSSLeaf[] upperTreehashLeaf,
                         int[] minTreehash,
                         byte[][] nextRoot,
                         GMSSRootCalc[] nextNextRoot,
                         byte[][] currentRootSig,
                         GMSSRootSig[] nextRootSig,
                         GMSSParameterset gmssParameterset,
                         java.lang.String[] algNames)
Generates a new GMSS private key
Parameters:
index - tree indices
currentSeeds - seed for the generation of private OTS keys for the current subtrees (TREE)
nextNextSeeds - seed for the generation of private OTS keys for the subtrees after next (TREE++)
currentAuthPaths - array of current authentication paths (AUTHPATH)
nextAuthPaths - array of next authentication paths (AUTHPATH+)
keep - keep array for the authPath algorithm
currentTreehash - treehash for authPath algorithm of current tree
nextTreehash - treehash for authPath algorithm of next tree (TREE+)
currentStack - shared stack for authPath algorithm of current tree
nextStack - shared stack for authPath algorithm of next tree (TREE+)
currentRetain - retain stack for authPath algorithm of current tree
nextRetain - retain stack for authPath algorithm of next tree (TREE+)
nextNextLeaf - array of upcoming leafs of the tree after next (LEAF++) of each layer
upperLeaf - needed for precomputation of upper nodes
upperTreehashLeaf - needed for precomputation of upper treehash nodes
nextRoot - the roots of the next trees (ROOT+)
nextNextRoot - the roots of the tree after next (ROOT++)
currentRootSig - array of signatures of the roots of the current subtrees (SIG)
nextRootSig - array of signatures of the roots of the next subtree (SIG+)
gmssParameterset - the GMSS Parameterset
algNames - An array of strings, containing the name of the used hash function and the name of the corresponding provider
Method Detail

nextKey

public void nextKey(int layer)
This method updates the GMSS private key for the next signature
Parameters:
layer - the layer where the next key is processed

getAlgorithm

public java.lang.String getAlgorithm()
Returns:
The name of the algorithm

getName

public java.lang.String[] getName()
Returns:
The detailed name of the algorithm

getOID

protected codec.asn1.ASN1ObjectIdentifier getOID()
Overrides:
getOID in class PrivateKey
Returns:
the OID to encode in the SubjectPublicKeyInfo structure

getAlgParams

protected codec.asn1.ASN1Type getAlgParams()
Overrides:
getAlgParams in class PrivateKey
Returns:
the algorithm parameters to encode in the SubjectPublicKeyInfo structure

getKeyData

protected byte[] getKeyData()
Overrides:
getKeyData in class PrivateKey
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure

getIndex

protected int[] getIndex()
Returns:
The current indices array

getIndex

protected int getIndex(int i)
Returns:
The current index of layer i

getCurrentSeeds

protected byte[][] getCurrentSeeds()
Returns:
The array of current seeds

getNextNextSeeds

protected byte[][] getNextNextSeeds()
Returns:
The array of seeds after next (SEED++)

getCurrentAuthPaths

protected byte[][][] getCurrentAuthPaths()
Returns:
The current authentication path array

getNextAuthPaths

protected byte[][][] getNextAuthPaths()
Returns:
The next authentication path array

getCurrentTreehash

protected Treehash[][] getCurrentTreehash()
Returns:
The current treehash instances

getNextTreehash

protected Treehash[][] getNextTreehash()
Returns:
The next treehash instances

getCurrentStack

protected java.util.Vector[] getCurrentStack()
Returns:
The current treehash instances

getNextStack

protected java.util.Vector[] getNextStack()
Returns:
The next treehash instances

getCurrentRetain

protected java.util.Vector[][] getCurrentRetain()
Returns:
The current treehash instances

getNextRetain

protected java.util.Vector[][] getNextRetain()
Returns:
The next treehash instances

getNumLeafs

protected int getNumLeafs(int i)
Returns:
The number of leafs of each tree of layer i

getNumLeafs

protected int[] getNumLeafs()
Returns:
The array of number of leafs of a tree of each layer

getKeep

protected byte[][][] getKeep()
Returns:
The stack array keep

getNextNextLeaf

protected GMSSLeaf[] getNextNextLeaf()
Returns:
An array of the GMSSLeafs of the tree after next of each layer (LEAF++)

getUpperLeaf

protected GMSSLeaf[] getUpperLeaf()
Returns:
An array of the GMSSLeafs of the tree after next of each layer (LEAF++)

getUpperTreehashLeaf

protected GMSSLeaf[] getUpperTreehashLeaf()
Returns:
An array of the GMSSLeafs of the tree after next of each layer (LEAF++)

getMinTreehash

protected int[] getMinTreehash()
Returns:
An array of the indices of the next treehashs to receive updates

getNextRoot

protected byte[][] getNextRoot()
Returns:
An array of roots of the next subtree of each layer (ROOT+)

getNextNextRoot

protected GMSSRootCalc[] getNextNextRoot()
Returns:
An array of roots of the subtree after next of each layer (ROOT++)

getCurrentRootSig

protected byte[][] getCurrentRootSig()
Returns:
An array of signatures of the current subtree roots of each layer

getParameterset

protected GMSSParameterset getParameterset()
Returns:
the GMSSParameterset

getSubtreeRootSig

protected byte[] getSubtreeRootSig(int i)
Returns:
The one-time signature of the root of the current subtree

getNextRootSig

protected GMSSRootSig[] getNextRootSig()
Returns:
The one-time signatures of the next root (SIG+)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
A human readable representation of main part of the key