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

public Class GMSSSigner

extends Object
implements MessageSigner
Class Inheritance
All Implemented Interfaces
org.bouncycastle.pqc.crypto.MessageSigner
Imports
java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, .CryptoServicesRegistrar, .Digest, org.bouncycastle.crypto.params.ParametersWithRandom, org.bouncycastle.pqc.crypto.MessageSigner, org.bouncycastle.pqc.legacy.crypto.gmss.util.GMSSRandom, .GMSSUtil, .WinternitzOTSVerify, .WinternitzOTSignature, org.bouncycastle.util.Arrays

This class implements the GMSS signature scheme.

Field Summary

Modifier and TypeField and Description
private byte[][][]
currentAuthPaths

Array of the authentication paths for the current trees of all layers

private GMSSDigestProvider
digestProvider

Array of strings containing the name of the hash function used by the OTS and the corresponding provider name

private GMSSParameters
gmssPS

The GMSSParameterset

private GMSSRandom
gmssRandom

The PRNG

private GMSSUtil
gmssUtil

Instance of GMSSUtilities

private int[]
index

The current main tree and subtree indices

pack-priv GMSSKeyParameters
private int
mdLength

The length of the hash function output

private Digest
messDigestOTS

The hash function used by the OTS

private Digest
messDigestTrees

Hash function for the construction of the authentication trees

private int
numLayer

The number of tree layers

private WinternitzOTSignature
ots

An instance of the Winternitz one-time signature

private byte[]
pubKeyBytes

The raw GMSS public key

private SecureRandom
private byte[][]
subtreeRootSig

The one-time signature of the roots of the current subtrees

Constructor Summary

AccessConstructor and Description
public
GMSSSigner(GMSSDigestProvider
the digest to use
digest
)

The standard constructor tries to generate the MerkleTree Algorithm identifier with the corresponding OID.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the signature.
generateSignature
(byte[]
the message to be signed.
message
)

Implements org.bouncycastle.pqc.crypto.MessageSigner.generateSignature.

Signs a message.
public void
init(boolean
true if we are generating a signature, false otherwise.
forSigning
,
CipherParameters
key parameters for signature generation.
param
)

Implements org.bouncycastle.pqc.crypto.MessageSigner.init.

initialise the signer for signature generation or signature verification.
private void
initSign()

Initializes the signature algorithm for signing a message.

private void
initVerify()

Initializes the signature algorithm for verifying a signature.

public boolean

Returns:

true if the signature has been verified, false otherwise.
verifySignature
(byte[]
the message
message
,
byte[]
the signature associated with the message
signature
)

Implements org.bouncycastle.pqc.crypto.MessageSigner.verifySignature.

This function verifies the signature of the message that has been updated, with the aid of the public key.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentAuthPathsback to summary
private byte[][][] currentAuthPaths

Array of the authentication paths for the current trees of all layers

digestProviderback to summary
private GMSSDigestProvider digestProvider

Array of strings containing the name of the hash function used by the OTS and the corresponding provider name

gmssPSback to summary
private GMSSParameters gmssPS

The GMSSParameterset

gmssRandomback to summary
private GMSSRandom gmssRandom

The PRNG

gmssUtilback to summary
private GMSSUtil gmssUtil

Instance of GMSSUtilities

indexback to summary
private int[] index

The current main tree and subtree indices

keyback to summary
pack-priv GMSSKeyParameters key
mdLengthback to summary
private int mdLength

The length of the hash function output

messDigestOTSback to summary
private Digest messDigestOTS

The hash function used by the OTS

messDigestTreesback to summary
private Digest messDigestTrees

Hash function for the construction of the authentication trees

numLayerback to summary
private int numLayer

The number of tree layers

otsback to summary
private WinternitzOTSignature ots

An instance of the Winternitz one-time signature

pubKeyBytesback to summary
private byte[] pubKeyBytes

The raw GMSS public key

randomback to summary
private SecureRandom random
subtreeRootSigback to summary
private byte[][] subtreeRootSig

The one-time signature of the roots of the current subtrees

Constructor Detail

GMSSSignerback to summary
public GMSSSigner(GMSSDigestProvider digest)

The standard constructor tries to generate the MerkleTree Algorithm identifier with the corresponding OID.

Parameters
digest:GMSSDigestProvider

the digest to use

Method Detail

generateSignatureback to summary
public byte[] generateSignature(byte[] message)

Implements org.bouncycastle.pqc.crypto.MessageSigner.generateSignature.

Signs a message.

Parameters
message:byte[]

Doc from org.bouncycastle.pqc.crypto.MessageSigner.generateSignature.

the message to be signed.

Returns:byte[]

the signature.

initback to summary
public void init(boolean forSigning, CipherParameters param)

Implements org.bouncycastle.pqc.crypto.MessageSigner.init.

Doc from org.bouncycastle.pqc.crypto.MessageSigner.init.

initialise the signer for signature generation or signature verification.

Parameters
forSigning:boolean

true if we are generating a signature, false otherwise.

param:CipherParameters

key parameters for signature generation.

initSignback to summary
private void initSign()

Initializes the signature algorithm for signing a message.

initVerifyback to summary
private void initVerify()

Initializes the signature algorithm for verifying a signature.

verifySignatureback to summary
public boolean verifySignature(byte[] message, byte[] signature)

Implements org.bouncycastle.pqc.crypto.MessageSigner.verifySignature.

This function verifies the signature of the message that has been updated, with the aid of the public key.

Parameters
message:byte[]

the message

signature:byte[]

the signature associated with the message

Returns:boolean

true if the signature has been verified, false otherwise.