Class BCRainbowPublicKey

java.lang.Object
org.bouncycastle.pqc.jcajce.provider.rainbow.BCRainbowPublicKey
All Implemented Interfaces:
Serializable, Key, PublicKey

public class BCRainbowPublicKey extends Object implements PublicKey
This class implements CipherParameters and PublicKey.

The public key in Rainbow consists of n - v1 polynomial components of the private key's F and the field structure of the finite field k.

The quadratic (or mixed) coefficients of the polynomials from the public key are stored in the 2-dimensional array in lexicographical order, requiring n * (n + 1) / 2 entries for each polynomial. The singular terms are stored in a 2-dimensional array requiring n entries per polynomial, the scalar term of each polynomial is stored in a 1-dimensional array.

More detailed information on the public 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 Details

    • BCRainbowPublicKey

      public BCRainbowPublicKey(int docLength, short[][] coeffQuadratic, short[][] coeffSingular, short[] coeffScalar)
      Constructor
      Parameters:
      docLength -
      coeffQuadratic -
      coeffSingular -
      coeffScalar -
    • BCRainbowPublicKey

      public BCRainbowPublicKey(RainbowPublicKeySpec keySpec)
      Constructor (used by the RainbowKeyFactorySpi).
      Parameters:
      keySpec - a RainbowPublicKeySpec
    • BCRainbowPublicKey

      public BCRainbowPublicKey(RainbowPublicKeyParameters params)
  • Method Details

    • getDocLength

      public int getDocLength()
      Returns:
      the docLength
    • getCoeffQuadratic

      public short[][] getCoeffQuadratic()
      Returns:
      the coeffQuadratic
    • getCoeffSingular

      public short[][] getCoeffSingular()
      Returns:
      the coeffSingular
    • getCoeffScalar

      public short[] getCoeffScalar()
      Returns:
      the coeffScalar
    • equals

      public boolean equals(Object other)
      Compare this Rainbow public key with another object.
      Overrides:
      equals in class Object
      Parameters:
      other - the other object
      Returns:
      the result of the comparison
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getAlgorithm

      public final String getAlgorithm()
      Specified by:
      getAlgorithm in interface Key
      Returns:
      name of the algorithm - "Rainbow"
    • getFormat

      public String getFormat()
      Specified by:
      getFormat in interface Key
    • getEncoded

      public byte[] getEncoded()
      Specified by:
      getEncoded in interface Key