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

public Class GMSSLeaf

extends Object
Class Inheritance
Imports
org.bouncycastle.crypto.Digest, org.bouncycastle.pqc.legacy.crypto.gmss.util.GMSSRandom, org.bouncycastle.util.Arrays, org.bouncycastle.util.encoders.Hex

This class implements the distributed computation of the public key of the Winternitz one-time signature scheme (OTSS). The class is used by the GMSS classes for calculation of upcoming leafs.

Field Summary

Modifier and TypeField and Description
private byte[]
concHashs

Byte array for storing the concatenated hashes of private key parts

private GMSSRandom
gmssRandom

The source of randomness for OTS private key generation

private int
i

indices for distributed computation

private int
j

indices for distributed computation

private int
keysize

The length of the message digest and private key

private byte[]
leaf

Byte array for distributed computation of the upcoming leaf

private int
mdsize

The length of the message digest and private key

private Digest
messDigestOTS

The hash function used by the OTS and the PRNG

pack-priv byte[]
privateKeyOTS

the OTS privateKey parts

private byte[]
seed

the internal seed

private int
steps

the amount of distributed computation steps when updateLeaf is called

private int
two_power_w

storing 2^w

private int
w

Winternitz parameter w

Constructor Summary

AccessConstructor and Description
public
GMSSLeaf(Digest
an array of strings, containing the name of the used hash function and PRNG and the name of the corresponding provider
digest
,
byte[][]
status bytes
otsIndex
,
int[]
status ints
numLeafs
)

This constructor regenerates a prior GMSSLeaf object

pack-priv
GMSSLeaf(Digest
an array of strings, containing the digest of the used hash function and PRNG and the digest of the corresponding provider
digest
,
int
the winterniz parameter of that tree the leaf is computed for
w
,
int
the number of leafs of the tree from where the distributed computation is called
numLeafs
)

The constructor precomputes some needed variables for distributed leaf calculation

public
GMSSLeaf(Digest digest, int w, int numLeafs, byte[] seed0)

private
GMSSLeaf(GMSSLeaf original)

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the leaf value
getLeaf
()

Returns the leaf value.

private int

Returns:

The least integer greater or equal to the logarithm to the base 2 of intValue
getLog
(int
an integer
intValue
)

This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integer intValue.

public byte[][]

Returns:

The status bytes
getStatByte
()

Returns the status byte array used by the GMSSPrivateKeyASN.1 class

public int[]

Returns:

The status ints
getStatInt
()

Returns the status int array used by the GMSSPrivateKeyASN.1 class

pack-priv void
initLeafCalc(byte[]
the starting seed
seed0
)

initialize the distributed leaf calculation reset i,j and compute OTSseed with seed0

pack-priv GMSSLeaf
public String

Returns:

a String representation of the main part of this element
toString
()

Overrides java.lang.Object.toString.

Returns a String representation of the main part of this element

private void

Returns:

true if leaf is completed, else false
updateLeafCalc
()

Processes steps steps of distributed leaf calculation

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

concHashsback to summary
private byte[] concHashs

Byte array for storing the concatenated hashes of private key parts

gmssRandomback to summary
private GMSSRandom gmssRandom

The source of randomness for OTS private key generation

iback to summary
private int i

indices for distributed computation

jback to summary
private int j

indices for distributed computation

keysizeback to summary
private int keysize

The length of the message digest and private key

leafback to summary
private byte[] leaf

Byte array for distributed computation of the upcoming leaf

mdsizeback to summary
private int mdsize

The length of the message digest and private key

messDigestOTSback to summary
private Digest messDigestOTS

The hash function used by the OTS and the PRNG

privateKeyOTSback to summary
pack-priv byte[] privateKeyOTS

the OTS privateKey parts

seedback to summary
private byte[] seed

the internal seed

stepsback to summary
private int steps

the amount of distributed computation steps when updateLeaf is called

two_power_wback to summary
private int two_power_w

storing 2^w

wback to summary
private int w

Winternitz parameter w

Constructor Detail

GMSSLeafback to summary
public GMSSLeaf(Digest digest, byte[][] otsIndex, int[] numLeafs)

This constructor regenerates a prior GMSSLeaf object

Parameters
digest:Digest

an array of strings, containing the name of the used hash function and PRNG and the name of the corresponding provider

otsIndex:byte[][]

status bytes

numLeafs:int[]

status ints

GMSSLeafback to summary
pack-priv GMSSLeaf(Digest digest, int w, int numLeafs)

The constructor precomputes some needed variables for distributed leaf calculation

Parameters
digest:Digest

an array of strings, containing the digest of the used hash function and PRNG and the digest of the corresponding provider

w:int

the winterniz parameter of that tree the leaf is computed for

numLeafs:int

the number of leafs of the tree from where the distributed computation is called

GMSSLeafback to summary
public GMSSLeaf(Digest digest, int w, int numLeafs, byte[] seed0)
GMSSLeafback to summary
private GMSSLeaf(GMSSLeaf original)

Method Detail

getLeafback to summary
public byte[] getLeaf()

Returns the leaf value.

Returns:byte[]

the leaf value

getLogback to summary
private int getLog(int intValue)

This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integer intValue.

Parameters
intValue:int

an integer

Returns:int

The least integer greater or equal to the logarithm to the base 2 of intValue

getStatByteback to summary
public byte[][] getStatByte()

Returns the status byte array used by the GMSSPrivateKeyASN.1 class

Returns:byte[][]

The status bytes

getStatIntback to summary
public int[] getStatInt()

Returns the status int array used by the GMSSPrivateKeyASN.1 class

Returns:int[]

The status ints

initLeafCalcback to summary
pack-priv void initLeafCalc(byte[] seed0)

initialize the distributed leaf calculation reset i,j and compute OTSseed with seed0

Parameters
seed0:byte[]

the starting seed

nextLeafback to summary
pack-priv GMSSLeaf nextLeaf()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String representation of the main part of this element

Returns:String

a String representation of the main part of this element

updateLeafCalcback to summary
private void updateLeafCalc()

Processes steps steps of distributed leaf calculation

Returns:void

true if leaf is completed, else false