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

public Class SLHDSASigner

extends Object
implements MessageSigner
Class Inheritance
All Implemented Interfaces
org.bouncycastle.pqc.crypto.MessageSigner
Imports
java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, org.bouncycastle.crypto.params.ParametersWithContext, .ParametersWithRandom, org.bouncycastle.pqc.crypto.MessageSigner, org.bouncycastle.util.Arrays

SLH-DA signer.

This version is based on the 3rd submission with deference to the updated reference implementation on github as at November 9th 2021. This version includes the changes for the countermeasure for the long-message second preimage attack - see "https://github.com/sphincs/sphincsplus/commit/61cd2695c6f984b4f4d6ed675378ed9a486cbede" for further details.

Field Summary

Modifier and TypeField and Description
private static final byte[]
private byte[]
private SLHDSAPrivateKeyParameters
private SLHDSAPublicKeyParameters
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
SLHDSASigner()

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public byte[]
generateSignature(byte[]
the message to be signed.
message
)

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

sign the passed in message (usually the output of a hash function).

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.

protected byte[]
internalGenerateSignature(byte[] message, byte[] optRand)

private static byte[]
internalGenerateSignature(SLHDSAPrivateKeyParameters privKey, byte[] msgPrefix, byte[] msg, byte[] optRand)

protected boolean
internalVerifySignature(byte[] message, byte[] signature)

private static boolean
internalVerifySignature(SLHDSAPublicKeyParameters pubKey, byte[] msgPrefix, byte[] msg, byte[] signature)

public boolean
verifySignature(byte[]
the message that was supposed to have been signed.
message
,
byte[]
the signature of the message
signature
)

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

verify the message message against the signature value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_PREFIXback to summary
private static final byte[] DEFAULT_PREFIX
msgPrefixback to summary
private byte[] msgPrefix
privKeyback to summary
private SLHDSAPrivateKeyParameters privKey
pubKeyback to summary
private SLHDSAPublicKeyParameters pubKey
randomback to summary
private SecureRandom random

Constructor Detail

SLHDSASignerback to summary
public SLHDSASigner()

Base constructor.

Method Detail

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

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

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

sign the passed in message (usually the output of a hash function).

Parameters
message:byte[]

the message to be signed.

Returns:byte[]

the signature of the message

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.

internalGenerateSignatureback to summary
protected byte[] internalGenerateSignature(byte[] message, byte[] optRand)
internalGenerateSignatureback to summary
private static byte[] internalGenerateSignature(SLHDSAPrivateKeyParameters privKey, byte[] msgPrefix, byte[] msg, byte[] optRand)
internalVerifySignatureback to summary
protected boolean internalVerifySignature(byte[] message, byte[] signature)
internalVerifySignatureback to summary
private static boolean internalVerifySignature(SLHDSAPublicKeyParameters pubKey, byte[] msgPrefix, byte[] msg, byte[] signature)
verifySignatureback to summary
public boolean verifySignature(byte[] message, byte[] signature)

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

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

verify the message message against the signature value.

Parameters
message:byte[]

the message that was supposed to have been signed.

signature:byte[]

the signature of the message