Top Description Fields Constructors Methods
org.bouncycastle.pqc.legacy.crypto.gmss

public Class GMSSPrivateKeyParameters

extends GMSSKeyParameters
Class Inheritance
Imports
java.util.Vector, org.bouncycastle.crypto.Digest, org.bouncycastle.pqc.legacy.crypto.gmss.util.GMSSRandom, .WinternitzOTSignature, org.bouncycastle.util.Arrays

This class provides a specification for a GMSS private key.

Field Summary

Modifier and TypeField and Description
private byte[][][]
private Vector<E>[][]
private byte[][]
private byte[][]
private Vector<E>[]
private Treehash[][]
private GMSSDigestProvider
private GMSSParameters
private GMSSRandom
gmssRandom

The PRNG used for private key generation

private int[]
heightOfTrees

An array of the heights of the authentication trees of each layer

private int[]
private int[]
K

The parameter K needed for the authentication path computation

private byte[][][]
private int
mdLength

The message digest length

private Digest
messDigestTrees

The hash function used to construct the authentication trees

private int[]
private byte[][][]
private GMSSLeaf[]
private GMSSRootCalc[]
private byte[][]
private Vector<E>[][]
private byte[][]
private GMSSRootSig[]
private Vector<E>[]
private Treehash[][]
private int
numLayer

the number of Layers

private int[]
numLeafs

The number of leafs of one tree of each layer

private int[]
otsIndex

An array of the Winternitz parameter 'w' of each layer

private GMSSLeaf[]
private GMSSLeaf[]
private boolean

Constructor Summary

AccessConstructor and Description
public
GMSSPrivateKeyParameters(byte[][]
seed for the generation of private OTS keys for the current subtrees
currentSeed
,
byte[][]
seed for the generation of private OTS keys for the next subtrees
nextNextSeed
,
byte[][][]
array of current authentication paths
currentAuthPath
,
byte[][][]
array of next authentication paths
nextAuthPath
,
Treehash[][]
array of current treehash instances
currentTreehash
,
Treehash[][]
array of next treehash instances
nextTreehash
,
Vector<E>[]
array of current shared stacks
currentStack
,
Vector<E>[]
array of next shared stacks
nextStack
,
Vector<E>[][]
array of current retain stacks
currentRetain
,
Vector<E>[][]
array of next retain stacks
nextRetain
,
byte[][]
the roots of the next subtree
nextRoot
,
byte[][]
array of signatures of the roots of the current subtrees
currentRootSig
,
GMSSParameters
the GMSS Parameterset
gmssParameterset
,
GMSSDigestProvider digestProvider)

Generates a new GMSS private key

public
GMSSPrivateKeyParameters(int[]
tree indices
index
,
byte[][] currentSeeds, byte[][] nextNextSeeds, byte[][][] currentAuthPaths, byte[][][] nextAuthPaths, byte[][][]
keep array for the authPath algorithm
keep
,
Treehash[][]
treehash for authPath algorithm of current tree
currentTreehash
,
Treehash[][]
treehash for authPath algorithm of next tree (TREE+)
nextTreehash
,
Vector<E>[]
shared stack for authPath algorithm of current tree
currentStack
,
Vector<E>[]
shared stack for authPath algorithm of next tree (TREE+)
nextStack
,
Vector<E>[][]
retain stack for authPath algorithm of current tree
currentRetain
,
Vector<E>[][]
retain stack for authPath algorithm of next tree (TREE+)
nextRetain
,
GMSSLeaf[]
array of upcoming leafs of the tree after next (LEAF++) of each layer
nextNextLeaf
,
GMSSLeaf[]
needed for precomputation of upper nodes
upperLeaf
,
GMSSLeaf[]
needed for precomputation of upper treehash nodes
upperTreehashLeaf
,
int[]
index of next treehash instance to receive an update
minTreehash
,
byte[][]
the roots of the next trees (ROOT+)
nextRoot
,
GMSSRootCalc[]
the roots of the tree after next (ROOT++)
nextNextRoot
,
byte[][]
array of signatures of the roots of the current subtrees (SIG)
currentRootSig
,
GMSSRootSig[]
array of signatures of the roots of the next subtree (SIG+)
nextRootSig
,
GMSSParameters
the GMSS Parameterset
gmssParameterset
,
GMSSDigestProvider digestProvider)

/**

private

Method Summary

Modifier and TypeMethod and Description
private void
computeAuthPaths(int
the actual layer
layer
)

Computes the upcoming currentAuthpath of layer layer using the revisited authentication path computation of Dahmen/Schneider 2008

public byte[][][]
public byte[][]
public int[]
public int

Returns:

The current index of layer i
getIndex
(int i)

private int

Returns:

index of the treehash instance that should get the update
getMinTreehashIndex
(int
the layer of the GMSS tree
layer
)

This method returns the index of the next Treehash instance that should receive an update

public GMSSDigestProvider
public int

Returns:

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

public byte[]

Returns:

The one-time signature of the root of the current subtree
getSubtreeRootSig
(int i)

private int

Returns:

The largest h with 2^h | Phi if Phi!=0 else return -1
heightOfPhi
(int
the leaf index
Phi
)

Returns the largest h such that 2^h | Phi

public boolean
public void
public GMSSPrivateKeyParameters
private void
nextKey(int
the layer where the next key is processed
layer
)

This method updates the GMSS private key for the next signature

private void
nextTree(int
the layer where the next tree is processed
layer
)

Switch to next subtree if the current one is depleted

private void
updateKey(int layer)

This method computes the authpath (AUTH) for the current tree, Additionally the root signature for the next tree (SIG+), the authpath (AUTH++) and root (ROOT++) for the tree after next in layer layer, and the LEAF++^1 for the next next tree in the layer above are updated This method is used by nextKey()

private void
updateNextNextAuthRoot(int layer)

Updates the authentication path and root calculation for the tree after next (AUTH++, ROOT++) in layer layer

Inherited from org.bouncycastle.pqc.legacy.crypto.gmss.GMSSKeyParameters:
getParameters

Field Detail

currentAuthPathsback to summary
private byte[][][] currentAuthPaths
currentRetainback to summary
private Vector<E>[][] currentRetain
currentRootSigback to summary
private byte[][] currentRootSig
currentSeedsback to summary
private byte[][] currentSeeds
currentStackback to summary
private Vector<E>[] currentStack
currentTreehashback to summary
private Treehash[][] currentTreehash
digestProviderback to summary
private GMSSDigestProvider digestProvider
gmssPSback to summary
private GMSSParameters gmssPS
gmssRandomback to summary
private GMSSRandom gmssRandom

The PRNG used for private key generation

heightOfTreesback to summary
private int[] heightOfTrees

An array of the heights of the authentication trees of each layer

indexback to summary
private int[] index
Kback to summary
private int[] K

The parameter K needed for the authentication path computation

keepback to summary
private byte[][][] keep
mdLengthback to summary
private int mdLength

The message digest length

messDigestTreesback to summary
private Digest messDigestTrees

The hash function used to construct the authentication trees

minTreehashback to summary
private int[] minTreehash
nextAuthPathsback to summary
private byte[][][] nextAuthPaths
nextNextLeafback to summary
private GMSSLeaf[] nextNextLeaf
nextNextRootback to summary
private GMSSRootCalc[] nextNextRoot
nextNextSeedsback to summary
private byte[][] nextNextSeeds
nextRetainback to summary
private Vector<E>[][] nextRetain
nextRootback to summary
private byte[][] nextRoot
nextRootSigback to summary
private GMSSRootSig[] nextRootSig
nextStackback to summary
private Vector<E>[] nextStack
nextTreehashback to summary
private Treehash[][] nextTreehash
numLayerback to summary
private int numLayer

the number of Layers

numLeafsback to summary
private int[] numLeafs

The number of leafs of one tree of each layer

otsIndexback to summary
private int[] otsIndex

An array of the Winternitz parameter 'w' of each layer

upperLeafback to summary
private GMSSLeaf[] upperLeaf
upperTreehashLeafback to summary
private GMSSLeaf[] upperTreehashLeaf
usedback to summary
private boolean used

Constructor Detail

GMSSPrivateKeyParametersback to summary
public GMSSPrivateKeyParameters(byte[][] currentSeed, byte[][] nextNextSeed, byte[][][] currentAuthPath, byte[][][] nextAuthPath, Treehash[][] currentTreehash, Treehash[][] nextTreehash, Vector<E>[] currentStack, Vector<E>[] nextStack, Vector<E>[][] currentRetain, Vector<E>[][] nextRetain, byte[][] nextRoot, byte[][] currentRootSig, GMSSParameters gmssParameterset, GMSSDigestProvider digestProvider)

Generates a new GMSS private key

Parameters
currentSeed:byte[][]

seed for the generation of private OTS keys for the current subtrees

nextNextSeed:byte[][]

seed for the generation of private OTS keys for the next subtrees

currentAuthPath:byte[][][]

array of current authentication paths

nextAuthPath:byte[][][]

array of next authentication paths

currentTreehash:Treehash[][]

array of current treehash instances

nextTreehash:Treehash[][]

array of next treehash instances

currentStack:Vector<E>[]

array of current shared stacks

nextStack:Vector<E>[]

array of next shared stacks

currentRetain:Vector<E>[][]

array of current retain stacks

nextRetain:Vector<E>[][]

array of next retain stacks

nextRoot:byte[][]

the roots of the next subtree

currentRootSig:byte[][]

array of signatures of the roots of the current subtrees

gmssParameterset:GMSSParameters

the GMSS Parameterset

See Also
org.bouncycastle.pqc.legacy.crypto.gmss.GMSSKeyPairGenerator
GMSSPrivateKeyParametersback to summary
public GMSSPrivateKeyParameters(int[] index, byte[][] currentSeeds, byte[][] nextNextSeeds, byte[][][] currentAuthPaths, byte[][][] nextAuthPaths, byte[][][] keep, Treehash[][] currentTreehash, Treehash[][] nextTreehash, Vector<E>[] currentStack, Vector<E>[] nextStack, Vector<E>[][] currentRetain, Vector<E>[][] nextRetain, GMSSLeaf[] nextNextLeaf, GMSSLeaf[] upperLeaf, GMSSLeaf[] upperTreehashLeaf, int[] minTreehash, byte[][] nextRoot, GMSSRootCalc[] nextNextRoot, byte[][] currentRootSig, GMSSRootSig[] nextRootSig, GMSSParameters gmssParameterset, GMSSDigestProvider digestProvider)

/**

Parameters
index:int[]

tree indices

keep:byte[][][]

keep array for the authPath algorithm

currentTreehash:Treehash[][]

treehash for authPath algorithm of current tree

nextTreehash:Treehash[][]

treehash for authPath algorithm of next tree (TREE+)

currentStack:Vector<E>[]

shared stack for authPath algorithm of current tree

nextStack:Vector<E>[]

shared stack for authPath algorithm of next tree (TREE+)

currentRetain:Vector<E>[][]

retain stack for authPath algorithm of current tree

nextRetain:Vector<E>[][]

retain stack for authPath algorithm of next tree (TREE+)

nextNextLeaf:GMSSLeaf[]

array of upcoming leafs of the tree after next (LEAF++) of each layer

upperLeaf:GMSSLeaf[]

needed for precomputation of upper nodes

upperTreehashLeaf:GMSSLeaf[]

needed for precomputation of upper treehash nodes

minTreehash:int[]

index of next treehash instance to receive an update

nextRoot:byte[][]

the roots of the next trees (ROOT+)

nextNextRoot:GMSSRootCalc[]

the roots of the tree after next (ROOT++)

currentRootSig:byte[][]

array of signatures of the roots of the current subtrees (SIG)

nextRootSig:GMSSRootSig[]

array of signatures of the roots of the next subtree (SIG+)

gmssParameterset:GMSSParameters

the GMSS Parameterset

GMSSPrivateKeyParametersback to summary
private GMSSPrivateKeyParameters(GMSSPrivateKeyParameters original)

Method Detail

computeAuthPathsback to summary
private void computeAuthPaths(int layer)

Computes the upcoming currentAuthpath of layer layer using the revisited authentication path computation of Dahmen/Schneider 2008

Parameters
layer:int

the actual layer

getCurrentAuthPathsback to summary
public byte[][][] getCurrentAuthPaths()
getCurrentSeedsback to summary
public byte[][] getCurrentSeeds()
getIndexback to summary
public int[] getIndex()
getIndexback to summary
public int getIndex(int i)
Returns:int

The current index of layer i

getMinTreehashIndexback to summary
private int getMinTreehashIndex(int layer)

This method returns the index of the next Treehash instance that should receive an update

Parameters
layer:int

the layer of the GMSS tree

Returns:int

index of the treehash instance that should get the update

getNameback to summary
public GMSSDigestProvider getName()
getNumLeafsback to summary
public int getNumLeafs(int i)
Returns:int

The number of leafs of each tree of layer i

getSubtreeRootSigback to summary
public byte[] getSubtreeRootSig(int i)
Returns:byte[]

The one-time signature of the root of the current subtree

heightOfPhiback to summary
private int heightOfPhi(int Phi)

Returns the largest h such that 2^h | Phi

Parameters
Phi:int

the leaf index

Returns:int

The largest h with 2^h | Phi if Phi!=0 else return -1

isUsedback to summary
public boolean isUsed()
markUsedback to summary
public void markUsed()
nextKeyback to summary
public GMSSPrivateKeyParameters nextKey()
nextKeyback to summary
private void nextKey(int layer)

This method updates the GMSS private key for the next signature

Parameters
layer:int

the layer where the next key is processed

nextTreeback to summary
private void nextTree(int layer)

Switch to next subtree if the current one is depleted

Parameters
layer:int

the layer where the next tree is processed

updateKeyback to summary
private void updateKey(int layer)

This method computes the authpath (AUTH) for the current tree, Additionally the root signature for the next tree (SIG+), the authpath (AUTH++) and root (ROOT++) for the tree after next in layer layer, and the LEAF++^1 for the next next tree in the layer above are updated This method is used by nextKey()

updateNextNextAuthRootback to summary
private void updateNextNextAuthRoot(int layer)

Updates the authentication path and root calculation for the tree after next (AUTH++, ROOT++) in layer layer