Top Description Fields Constructors Methods
org.bouncycastle.pqc.crypto.xmss

pack-priv final Class WOTSPlus

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, org.bouncycastle.util.Arrays

WOTS+.

Field Summary

Modifier and TypeField and Description
private final KeyedHashFunctions
khf

Randomization functions.

private final WOTSPlusParameters
params

WOTS+ parameters.

private byte[]
publicSeed

WOTS+ public seed.

private byte[]
secretKeySeed

WOTS+ secret key seed.

Constructor Summary

AccessConstructor and Description
pack-priv
WOTSPlus(WOTSPlusParameters
Parameters for WOTSPlus object.
params
)

Constructs a new WOTS+ one-time signature system based on the given WOTS+ parameters.

Method Summary

Modifier and TypeMethod and Description
private byte[]

Returns:

Value obtained by iterating F for steps times on input startHash, using the outputs of PRF.
chain
(byte[]
Starting point.
startHash
,
int
Start index.
startIndex
,
int
Steps to take.
steps
,
OTSHashAddress
OTS hash address for randomization.
otsHashAddress
)

Computes an iteration of F on an n-byte input using outputs of PRF.

private List<Integer>

Returns:

outLength-length list of base w integers.
convertToBaseW
(byte[]
Input data.
messageDigest
,
int
Base.
w
,
int
Length of output.
outLength
)

Obtain base w values from Input.

private byte[]

Returns:

Private key at index.
expandSecretKeySeed
(int
Index.
index
)

Derive private key at index from secret key seed.

protected KeyedHashFunctions

Returns:

keyed hash functions.
getKhf
()

Getter keyed hash functions.

protected WOTSPlusParameters

Returns:

params.
getParams
()

Getter parameters.

protected WOTSPlusPrivateKeyParameters

Returns:

WOTS+ private key.
getPrivateKey
()

Getter private key.

pack-priv WOTSPlusPublicKeyParameters

Returns:

WOTS+ public key.
getPublicKey
(OTSHashAddress
OTS hash address for randomization.
otsHashAddress
)

Calculates a new public key based on the state of secretKeySeed, publicSeed and otsHashAddress.

pack-priv WOTSPlusPublicKeyParameters

Returns:

WOTS+ public key derived from digest and signature.
getPublicKeyFromSignature
(byte[]
The digest that was signed.
messageDigest
,
WOTSPlusSignature
Signarure on digest.
signature
,
OTSHashAddress
OTS hash address for randomization.
otsHashAddress
)

Calculates a public key based on digest and signature.

protected byte[]

Returns:

public seed.
getPublicSeed
()

Getter public seed.

protected byte[]

Returns:

secret key seed.
getSecretKeySeed
()

Getter secret key seed.

protected byte[]

Returns:

WOTS+ secret key at index.
getWOTSPlusSecretKey
(byte[] secretKeySeed, OTSHashAddress
one time hash address.
otsHashAddress
)

Derive WOTS+ secret key for specific index as in XMSS ref impl Andreas Huelsing.

pack-priv void
importKeys(byte[]
Secret key seed.
secretKeySeed
,
byte[]
Public seed.
publicSeed
)

Import keys to WOTS+ instance.

pack-priv WOTSPlusSignature

Returns:

WOTS+ signature.
sign
(byte[]
Digest to sign.
messageDigest
,
OTSHashAddress
OTS hash address for randomization.
otsHashAddress
)

Creates a signature for the n-byte messageDigest.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

khfback to summary
private final KeyedHashFunctions khf

Randomization functions.

paramsback to summary
private final WOTSPlusParameters params

WOTS+ parameters.

publicSeedback to summary
private byte[] publicSeed

WOTS+ public seed.

secretKeySeedback to summary
private byte[] secretKeySeed

WOTS+ secret key seed.

Constructor Detail

WOTSPlusback to summary
pack-priv WOTSPlus(WOTSPlusParameters params)

Constructs a new WOTS+ one-time signature system based on the given WOTS+ parameters.

Parameters
params:WOTSPlusParameters

Parameters for WOTSPlus object.

Method Detail

chainback to summary
private byte[] chain(byte[] startHash, int startIndex, int steps, OTSHashAddress otsHashAddress)

Computes an iteration of F on an n-byte input using outputs of PRF.

Parameters
startHash:byte[]

Starting point.

startIndex:int

Start index.

steps:int

Steps to take.

otsHashAddress:OTSHashAddress

OTS hash address for randomization.

Returns:byte[]

Value obtained by iterating F for steps times on input startHash, using the outputs of PRF.

convertToBaseWback to summary
private List<Integer> convertToBaseW(byte[] messageDigest, int w, int outLength)

Obtain base w values from Input.

Parameters
messageDigest:byte[]

Input data.

w:int

Base.

outLength:int

Length of output.

Returns:List<Integer>

outLength-length list of base w integers.

expandSecretKeySeedback to summary
private byte[] expandSecretKeySeed(int index)

Derive private key at index from secret key seed.

Parameters
index:int

Index.

Returns:byte[]

Private key at index.

getKhfback to summary
protected KeyedHashFunctions getKhf()

Getter keyed hash functions.

Returns:KeyedHashFunctions

keyed hash functions.

getParamsback to summary
protected WOTSPlusParameters getParams()

Getter parameters.

Returns:WOTSPlusParameters

params.

getPrivateKeyback to summary
protected WOTSPlusPrivateKeyParameters getPrivateKey()

Getter private key.

Returns:WOTSPlusPrivateKeyParameters

WOTS+ private key.

getPublicKeyback to summary
pack-priv WOTSPlusPublicKeyParameters getPublicKey(OTSHashAddress otsHashAddress)

Calculates a new public key based on the state of secretKeySeed, publicSeed and otsHashAddress.

Parameters
otsHashAddress:OTSHashAddress

OTS hash address for randomization.

Returns:WOTSPlusPublicKeyParameters

WOTS+ public key.

getPublicKeyFromSignatureback to summary
pack-priv WOTSPlusPublicKeyParameters getPublicKeyFromSignature(byte[] messageDigest, WOTSPlusSignature signature, OTSHashAddress otsHashAddress)

Calculates a public key based on digest and signature.

Parameters
messageDigest:byte[]

The digest that was signed.

signature:WOTSPlusSignature

Signarure on digest.

otsHashAddress:OTSHashAddress

OTS hash address for randomization.

Returns:WOTSPlusPublicKeyParameters

WOTS+ public key derived from digest and signature.

getPublicSeedback to summary
protected byte[] getPublicSeed()

Getter public seed.

Returns:byte[]

public seed.

getSecretKeySeedback to summary
protected byte[] getSecretKeySeed()

Getter secret key seed.

Returns:byte[]

secret key seed.

getWOTSPlusSecretKeyback to summary
protected byte[] getWOTSPlusSecretKey(byte[] secretKeySeed, OTSHashAddress otsHashAddress)

Derive WOTS+ secret key for specific index as in XMSS ref impl Andreas Huelsing.

Parameters
otsHashAddress:OTSHashAddress

one time hash address.

Returns:byte[]

WOTS+ secret key at index.

importKeysback to summary
pack-priv void importKeys(byte[] secretKeySeed, byte[] publicSeed)

Import keys to WOTS+ instance.

Parameters
secretKeySeed:byte[]

Secret key seed.

publicSeed:byte[]

Public seed.

signback to summary
pack-priv WOTSPlusSignature sign(byte[] messageDigest, OTSHashAddress otsHashAddress)

Creates a signature for the n-byte messageDigest.

Parameters
messageDigest:byte[]

Digest to sign.

otsHashAddress:OTSHashAddress

OTS hash address for randomization.

Returns:WOTSPlusSignature

WOTS+ signature.