Class BCRainbowPrivateKey
java.lang.Object
org.bouncycastle.pqc.jcajce.provider.rainbow.BCRainbowPrivateKey
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
The Private key in Rainbow consists of the linear affine maps L1, L2 and the
map F, consisting of quadratic polynomials. In this implementation, we
denote: L1 = A1*x + b1 L2 = A2*x + b2
The coefficients of the polynomials in F are stored in 3-dimensional arrays per layer. The indices of these arrays denote the polynomial, and the variables.
More detailed information about the private key 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)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBCRainbowPrivateKey
(short[][] A1inv, short[] b1, short[][] A2inv, short[] b2, int[] vi, Layer[] layers) Constructor.BCRainbowPrivateKey
(RainbowPrivateKeySpec keySpec) Constructor (used by theRainbowKeyFactorySpi
). -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare this Rainbow private key with another object.final String
short[]
getB1()
Getter for the translation part of the private quadratic map L1.short[]
getB2()
Getter for the translation part of the private quadratic map L2.byte[]
short[][]
getInvA1()
Getter for the inverse matrix of A1.short[][]
getInvA2()
Getter for the inverse matrix of A2Layer[]
Returns the layers contained in the private keyint[]
getVi()
Returns the array of vi-sint
hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Constructor Details
-
BCRainbowPrivateKey
public BCRainbowPrivateKey(short[][] A1inv, short[] b1, short[][] A2inv, short[] b2, int[] vi, Layer[] layers) Constructor.- Parameters:
A1inv
-b1
-A2inv
-b2
-layers
-
-
BCRainbowPrivateKey
Constructor (used by theRainbowKeyFactorySpi
).- Parameters:
keySpec
- aRainbowPrivateKeySpec
-
BCRainbowPrivateKey
-
-
Method Details
-
getInvA1
public short[][] getInvA1()Getter for the inverse matrix of A1.- Returns:
- the A1inv inverse
-
getB1
public short[] getB1()Getter for the translation part of the private quadratic map L1.- Returns:
- b1 the translation part of L1
-
getB2
public short[] getB2()Getter for the translation part of the private quadratic map L2.- Returns:
- b2 the translation part of L2
-
getInvA2
public short[][] getInvA2()Getter for the inverse matrix of A2- Returns:
- the A2inv
-
getLayers
Returns the layers contained in the private key- Returns:
- layers
-
getVi
public int[] getVi()Returns the array of vi-s- Returns:
- the vi
-
equals
Compare this Rainbow private key with another object. -
hashCode
public int hashCode() -
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
- Returns:
- name of the algorithm - "Rainbow"
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
-
getFormat
-