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

public Class WinternitzOTSignature

extends Object
Class Inheritance
Imports
org.bouncycastle.crypto.Digest

This class implements key pair generation and 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 int
checksumsize

Sizes of the message and the checksum, both

private GMSSRandom
gmssRandom

The source of randomness for OTS private key generation

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 and the checksum, both

private Digest
messDigestOTS

The hash function used by the OTS

private byte[][]
privateKeyOTS

The private key

private int
w

The Winternitz parameter

Constructor Summary

AccessConstructor and Description
public
WinternitzOTSignature(byte[]
the seed for the PRGN
seed0
,
Digest
an array of strings, containing the name of the used hash function, the name of the PRGN and the names of the corresponding providers
digest
,
int
the Winternitz parameter
w
)

The constructor generates an OTS key pair, using seed0 and the PRNG

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
getPrivateKey
()

public byte[]

Returns:

The public OTS key
getPublicKey
()

public byte[]

Returns:

The one-time signature of the message, generated with the private key
getSignature
(byte[] message)

private void
hashPrivateKeyBlock(int index, int rounds, byte[] buf, int off)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checksumsizeback to summary
private int checksumsize

Sizes of the message and the checksum, both

gmssRandomback to summary
private GMSSRandom gmssRandom

The source of randomness for OTS private key generation

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 and the checksum, both

messDigestOTSback to summary
private Digest messDigestOTS

The hash function used by the OTS

privateKeyOTSback to summary
private byte[][] privateKeyOTS

The private key

wback to summary
private int w

The Winternitz parameter

Constructor Detail

WinternitzOTSignatureback to summary
public WinternitzOTSignature(byte[] seed0, Digest digest, int w)

The constructor generates an OTS key pair, using seed0 and the PRNG

Parameters
seed0:byte[]

the seed for the PRGN

digest:Digest

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

w:int

the Winternitz parameter

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

getPrivateKeyback to summary
public byte[][] getPrivateKey()
Returns:byte[][]

The private OTS key

getPublicKeyback to summary
public byte[] getPublicKey()
Returns:byte[]

The public OTS key

getSignatureback to summary
public byte[] getSignature(byte[] message)
Returns:byte[]

The one-time signature of the message, generated with the private key

hashPrivateKeyBlockback to summary
private void hashPrivateKeyBlock(int index, int rounds, byte[] buf, int off)