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

public Class RainbowSigner

extends Object
implements MessageSigner
Class Inheritance
All Implemented Interfaces
org.bouncycastle.pqc.crypto.MessageSigner
Imports
java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, .CryptoServicesRegistrar, org.bouncycastle.crypto.params.ParametersWithRandom, org.bouncycastle.pqc.crypto.MessageSigner, org.bouncycastle.pqc.legacy.crypto.rainbow.util.ComputeInField, .GF2Field

It implements the sign and verify functions for the Rainbow Signature Scheme. Here the message, which has to be signed, is updated. The use of different hash functions is possible.

Detailed information about the signature and the verify-method is to be found in the paper of Jintai Ding, Dieter Schmidt: Rainbow, a New Multivariable Polynomial Signature Scheme. ACNS 2005: 164-175 (https://dx.doi.org/10.1007/11496137_12)

Field Summary

Modifier and TypeField and Description
private ComputeInField
pack-priv RainbowKeyParameters
private static final int
private SecureRandom
pack-priv int
private short[]
x

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the signature of the message.
generateSignature
(byte[]
the message
message
)

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

This function signs the message that has been updated, making use of the private key.
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 short[]

Returns:

Y_ the modified document needed for solving LES, (Y_ = A1^{-1}*(Y-b1)) linear map L1 = A1 x + b1.
initSign
(Layer[]
the current layer for which a LES is to be solved.
layer
,
short[]
the message that should be signed.
msg
)

initial operations before solving the Linear equation system.

private short[]

Returns:

message representative
makeMessageRepresentative
(byte[]
the message
message
)

This function creates the representative of the message which gets signed or verified.

public boolean

Returns:

true if the signature has been verified, false otherwise.
verifySignature
(byte[]
the message
message
,
byte[]
the signature of 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.
private short[]

Returns:

document hash of length n - v1
verifySignatureIntern
(short[]
vector of dimension n
signature
)

Signature verification using public key

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cfback to summary
private ComputeInField cf
keyback to summary
pack-priv RainbowKeyParameters key
MAXITSback to summary
private static final int MAXITS
randomback to summary
private SecureRandom random
signableDocumentLengthback to summary
pack-priv int signableDocumentLength
xback to summary
private short[] x

Constructor Detail

RainbowSignerback to summary
public RainbowSigner()

Method Detail

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

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

This function signs the message that has been updated, making use of the private key.

For computing the signature, L1 and L2 are needed, as well as LES should be solved for each layer in order to find the Oil-variables in the layer.

The Vinegar-variables of the first layer are random generated.

Parameters
message:byte[]

the message

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.

initSignback to summary
private short[] initSign(Layer[] layer, short[] msg)

initial operations before solving the Linear equation system.

Parameters
layer:Layer[]

the current layer for which a LES is to be solved.

msg:short[]

the message that should be signed.

Returns:short[]

Y_ the modified document needed for solving LES, (Y_ = A1^{-1}*(Y-b1)) linear map L1 = A1 x + b1.

makeMessageRepresentativeback to summary
private short[] makeMessageRepresentative(byte[] message)

This function creates the representative of the message which gets signed or verified.

Parameters
message:byte[]

the message

Returns:short[]

message representative

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 of the message

Returns:boolean

true if the signature has been verified, false otherwise.

verifySignatureInternback to summary
private short[] verifySignatureIntern(short[] signature)

Signature verification using public key

Parameters
signature:short[]

vector of dimension n

Returns:short[]

document hash of length n - v1