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

public Class GMSSRootSig

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

This class implements the distributed signature generation of the Winternitz one-time signature scheme (OTSS), described in C.Dods, N.P. Smart, and M. Stam, "Hash Based Digital Signature Schemes", LNCS 3796, pages 96–115, 2005. The class is used by the GMSS classes.

Field Summary

Modifier and TypeField and Description
private long
big8

variables for storing big numbers for the actual status of distributed signing

private int
checksum

The checksum part

private int
counter

Some variables for storing the actual status of distributed signing

private GMSSRandom
gmssRandom

The source of randomness for OTS private key generation

private byte[]
hash

The message bytes

private int
height

The height of the tree

private int
ii

Some variables for storing the actual status of distributed signing

private int
k

Some precalculated values

private int
keysize

The length of the message digest and private key

private int
mdsize

The length of the message digest and private key

private int
messagesize

Sizes of the message

private Digest
messDigestOTS

The hash function used by the OTS

private byte[]
privateKeyOTS

The private key

private int
r

Some variables for storing the actual status of distributed signing

private byte[]
seed

The current intern OTSseed

private byte[]
sign

The signature bytes

private int
steps

The necessary steps of each updateSign() call

private int
test

Some variables for storing the actual status of distributed signing

private long
test8

variables for storing big numbers for the actual status of distributed signing

private int
w

The Winternitz parameter

Constructor Summary

AccessConstructor and Description
public
GMSSRootSig(Digest
an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providers
digest
,
byte[][]
status byte array
statByte
,
int[]
status int array
statInt
)

This constructor regenerates a prior GMSSRootSig object used by the GMSSPrivateKeyASN.1 class

public
GMSSRootSig(Digest
an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providers
digest
,
int
the winternitz parameter
w
,
int
the heigth of the tree
height
)

The constructor generates the PRNG and initializes some variables

Method Summary

Modifier and TypeMethod and Description
public 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 private OTS key
getSig
()

public byte[][]

Returns:

statBytes
getStatByte
()

This method returns the status byte array

public int[]

Returns:

statInt
getStatInt
()

This method returns the status int array

public byte[]
getStatLong()

Converts the long parameters into byte arrays to store it in statByte-Array

public void
initSign(byte[]
the initial OTSseed
seed0
,
byte[]
the massage which will be signed
message
)

This method initializes the distributed sigature calculation.

private void

Returns:

The one-time signature of the message, generated step by step
oneStep
()

public String

Returns:

a string representation of the instance
toString
()

Overrides java.lang.Object.toString.

returns a string representation of the instance

public boolean

Returns:

true if signature is generated completly, else false
updateSign
()

This Method performs steps steps of distributed signature calculaion

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

big8back to summary
private long big8

variables for storing big numbers for the actual status of distributed signing

checksumback to summary
private int checksum

The checksum part

counterback to summary
private int counter

Some variables for storing the actual status of distributed signing

gmssRandomback to summary
private GMSSRandom gmssRandom

The source of randomness for OTS private key generation

hashback to summary
private byte[] hash

The message bytes

heightback to summary
private int height

The height of the tree

iiback to summary
private int ii

Some variables for storing the actual status of distributed signing

kback to summary
private int k

Some precalculated values

keysizeback to summary
private int keysize

The length of the message digest and private key

mdsizeback to summary
private int mdsize

The length of the message digest and private key

messagesizeback to summary
private int messagesize

Sizes of the message

messDigestOTSback to summary
private Digest messDigestOTS

The hash function used by the OTS

privateKeyOTSback to summary
private byte[] privateKeyOTS

The private key

rback to summary
private int r

Some variables for storing the actual status of distributed signing

seedback to summary
private byte[] seed

The current intern OTSseed

signback to summary
private byte[] sign

The signature bytes

stepsback to summary
private int steps

The necessary steps of each updateSign() call

testback to summary
private int test

Some variables for storing the actual status of distributed signing

test8back to summary
private long test8

variables for storing big numbers for the actual status of distributed signing

wback to summary
private int w

The Winternitz parameter

Constructor Detail

GMSSRootSigback to summary
public GMSSRootSig(Digest digest, byte[][] statByte, int[] statInt)

This constructor regenerates a prior GMSSRootSig object used by the GMSSPrivateKeyASN.1 class

Parameters
digest:Digest

an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providers

statByte:byte[][]

status byte array

statInt:int[]

status int array

GMSSRootSigback to summary
public GMSSRootSig(Digest digest, int w, int height)

The constructor generates the PRNG and initializes some variables

Parameters
digest:Digest

an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providers

w:int

the winternitz parameter

height:int

the heigth of the tree

Method Detail

getLogback to summary
public 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

getSigback to summary
public byte[] getSig()
Returns:byte[]

The private OTS key

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

This method returns the status byte array

Returns:byte[][]

statBytes

getStatIntback to summary
public int[] getStatInt()

This method returns the status int array

Returns:int[]

statInt

getStatLongback to summary
public byte[] getStatLong()

Converts the long parameters into byte arrays to store it in statByte-Array

initSignback to summary
public void initSign(byte[] seed0, byte[] message)

This method initializes the distributed sigature calculation. Variables are reseted and necessary steps are calculated

Parameters
seed0:byte[]

the initial OTSseed

message:byte[]

the massage which will be signed

oneStepback to summary
private void oneStep()
Returns:void

The one-time signature of the message, generated step by step

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

returns a string representation of the instance

Returns:String

a string representation of the instance

updateSignback to summary
public boolean updateSign()

This Method performs steps steps of distributed signature calculaion

Returns:boolean

true if signature is generated completly, else false