de.flexiprovider.pqc.rainbow
Class Layer

java.lang.Object
  |
  +--de.flexiprovider.pqc.rainbow.Layer

public class Layer
extends java.lang.Object

This class represents a layer of the Rainbow Oil- and Vinegar Map. Each Layer consists of oi polynomials with their coefficients, generated at random. To sign a document, we solve a LES (linear equation system) for each layer in order to find the oil variables of that layer and to be able to use the variables to compute the signature. This functionality is implemented in the RainbowSignature-class, by the aid of the private key. Each layer is a part of the private key. More information about the layer can be found in the paper of Jintai Ding, Dieter Schmidt: Rainbow, a New Multivariable Polynomial Signature Scheme. ACNS 2005: 164-175 (http://dx.doi.org/10.1007/11496137_12)

Author:
Patrick Neugebauer, Marius Senftleben, Tsvetoslava Vateva

Constructor Summary
Layer(int layerIndex, byte vi, byte viNext, byte[][][] coeffAlpha, byte[][][] coeffBeta, byte[][] coeffGamma, byte[] coeffEta)
          Constructor used by RainbowPrivateKeySpec.
Layer(int layerIndex, int vi, int viNext)
          Constructor.
Layer(short[][][] coeff_alpha, short[][][] coeff_beta, short[][] coeff_gamma, short[] coeff_eta)
          Constructor only used for printout of default examples
 
Method Summary
 boolean equals(java.lang.Object other)
          This function compares this Layer with another object.
 void generateCoefficients(SecureRandom sr)
          This function generates the coefficients of all polynomials in this layer at random using random generator.
 short[][][] getCoeffAlpha()
          Getter for the alpha-coefficients of the polynomials in this layer.
 short[][][] getCoeffBeta()
          Getter for the beta-coefficients of the polynomials in this layer.
 short[] getCoeffEta()
          Getter for the eta-coefficients of the polynomials in this layer.
 short[][] getCoeffGamma()
          Getter for the gamma-coefficients of the polynomials in this layer.
 int getLayerIndex()
          Getter for the index of the layer.
 int getOi()
          Getter for the number of Oil variables of this layer.
 int getVi()
          Getter for the number of vinegar variables of this layer.
 int getViNext()
          Getter for the number of vinegar variables of the next layer.
protected  short[][] plugInVinegars(short[] x)
          This method plugs in the vinegar variables into the polynomials of this layer and computes the coefficients of the Oil-variables as well as the free coefficient in each polynomial.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Layer

public Layer(int layerIndex,
             int vi,
             int viNext)
Constructor.
Parameters:
layerIndex - index of layer (from 0...u-2)
vi - number of vinegar variables of this layer
viNext - number of vinegar variables of next layer. It's the same as (num of oils) + (num of vinegars) of this layer.

Layer

public Layer(short[][][] coeff_alpha,
             short[][][] coeff_beta,
             short[][] coeff_gamma,
             short[] coeff_eta)
Constructor only used for printout of default examples
Parameters:
coeff_alpha - alpha-coefficients in the polynomials of this layer
coeff_beta - beta-coefficients in the polynomials of this layer
coeff_gamma - gamma-coefficients in the polynomials of this layer
coeff_eta - eta-coefficients in the polynomials of this layer

Layer

public Layer(int layerIndex,
             byte vi,
             byte viNext,
             byte[][][] coeffAlpha,
             byte[][][] coeffBeta,
             byte[][] coeffGamma,
             byte[] coeffEta)
Constructor used by RainbowPrivateKeySpec.
Parameters:
layerIndex - index of layer (from 0...u-2)
vi - number of vinegar variables of this layer
viNext - number of vinegar variables of next layer. It's the same as (num of oils) + (num of vinegars) of this layer.
coeffAlpha - alpha-coefficients in the polynomials of this layer
coeffBeta - beta-coefficients in the polynomials of this layer
coeffGamma - gamma-coefficients in the polynomials of this layer
coeffEta - eta-coefficients in the polynomials of this layer
Method Detail

generateCoefficients

public void generateCoefficients(SecureRandom sr)
This function generates the coefficients of all polynomials in this layer at random using random generator.
Parameters:
sr - the random generator which is to be used

plugInVinegars

protected short[][] plugInVinegars(short[] x)
This method plugs in the vinegar variables into the polynomials of this layer and computes the coefficients of the Oil-variables as well as the free coefficient in each polynomial. It is needed for computing the Oil variables while signing.
Parameters:
x - vinegar variables of this layer that should be plugged into the polynomials.
Returns:
coeff the coefficients of Oil variables and the free coeff in the polynomials of this layer.

getLayerIndex

public int getLayerIndex()
Getter for the index of the layer.
Returns:
the index of the current layer.

getVi

public int getVi()
Getter for the number of vinegar variables of this layer.
Returns:
the number of vinegar variables of this layer.

getViNext

public int getViNext()
Getter for the number of vinegar variables of the next layer.
Returns:
the number of vinegar variables of the next layer.

getOi

public int getOi()
Getter for the number of Oil variables of this layer.
Returns:
the number of oil variables of this layer.

getCoeffAlpha

public short[][][] getCoeffAlpha()
Getter for the alpha-coefficients of the polynomials in this layer.
Returns:
the coefficients of alpha-terms of this layer.

getCoeffBeta

public short[][][] getCoeffBeta()
Getter for the beta-coefficients of the polynomials in this layer.
Returns:
the coefficients of beta-terms of this layer.

getCoeffGamma

public short[][] getCoeffGamma()
Getter for the gamma-coefficients of the polynomials in this layer.
Returns:
the coefficients of gamma-terms of this layer

getCoeffEta

public short[] getCoeffEta()
Getter for the eta-coefficients of the polynomials in this layer.
Returns:
the coefficients eta of this layer

equals

public boolean equals(java.lang.Object other)
This function compares this Layer with another object.
Overrides:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison