this.A1 = new short[dim][dim]; this.A1inv = null; ComputeInField c = new ComputeInField(); A1inv = c.inverse(A1);
computeZerosUnder(false); // obtain zeros under the diagonal substitute();
ComputeInField c = new ComputeInField(); int rows = this.vi[this.vi.length - 1] - this.vi[0]; int vars = this.vi[this.vi.length - 1]; vect_tmp = c.multVect(coeff_alpha[p][x1][x2], this.A2[x1 + vins]); coeff_quadratic_3dim[crnt_row + p] = c.addSquareMatrix( coeff_quadratic_3dim[crnt_row + p], c .multVects(vect_tmp, this.A2[x2])); vect_tmp = c.multVect(this.b2[x2], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]); vect_tmp = c.multVect(coeff_alpha[p][x1][x2], this.A2[x2]); vect_tmp = c.multVect(b2[x1 + vins], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]); vect_tmp = c.multVect(coeff_beta[p][x1][x2], this.A2[x1]); coeff_quadratic_3dim[crnt_row + p] = c.addSquareMatrix( coeff_quadratic_3dim[crnt_row + p], c .multVects(vect_tmp, this.A2[x2])); vect_tmp = c.multVect(this.b2[x2], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]);
solVec = cf.solveEquation(layer[i].plugInVinegars(x), y_i); tmpVec = cf.addVect(((RainbowPrivateKeyParameters)this.key).getB2(), x); signature = cf.multiplyMatrix(((RainbowPrivateKeyParameters)this.key).getInvA2(), tmpVec);
/** * initial operations before solving the Linear equation system. * * @param layer the current layer for which a LES is to be solved. * @param msg the message that should be signed. * @return Y_ the modified document needed for solving LES, (Y_ = * A1^{-1}*(Y-b1)) linear map L1 = A1 x + b1. */ private short[] initSign(Layer[] layer, short[] msg) { /* preparation: Modifies the document with the inverse of L1 */ // tmp = Y - b1: short[] tmpVec = new short[msg.length]; tmpVec = cf.addVect(((RainbowPrivateKeyParameters)this.key).getB1(), msg); // Y_ = A1^{-1} * (Y - b1) : short[] Y_ = cf.multiplyMatrix(((RainbowPrivateKeyParameters)this.key).getInvA1(), tmpVec); /* generates the vinegar vars of the first layer at random */ for (int i = 0; i < layer[0].getVi(); i++) { x[i] = (short)random.nextInt(); x[i] = (short)(x[i] & GF2Field.MASK); } return Y_; }
ComputeInField c = new ComputeInField(); int rows = this.vi[this.vi.length - 1] - this.vi[0]; int vars = this.vi[this.vi.length - 1]; vect_tmp = c.multVect(coeff_alpha[p][x1][x2], this.A2[x1 + vins]); coeff_quadratic_3dim[crnt_row + p] = c.addSquareMatrix( coeff_quadratic_3dim[crnt_row + p], c .multVects(vect_tmp, this.A2[x2])); vect_tmp = c.multVect(this.b2[x2], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]); vect_tmp = c.multVect(coeff_alpha[p][x1][x2], this.A2[x2]); vect_tmp = c.multVect(b2[x1 + vins], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]); vect_tmp = c.multVect(coeff_beta[p][x1][x2], this.A2[x1]); coeff_quadratic_3dim[crnt_row + p] = c.addSquareMatrix( coeff_quadratic_3dim[crnt_row + p], c .multVects(vect_tmp, this.A2[x2])); vect_tmp = c.multVect(this.b2[x2], vect_tmp); this.pub_singular[crnt_row + p] = c.addVect(vect_tmp, this.pub_singular[crnt_row + p]);
solVec = cf.solveEquation(layer[i].plugInVinegars(x), y_i); tmpVec = cf.addVect(((RainbowPrivateKeyParameters)this.key).getB2(), x); signature = cf.multiplyMatrix(((RainbowPrivateKeyParameters)this.key).getInvA2(), tmpVec);
/** * initial operations before solving the Linear equation system. * * @param layer the current layer for which a LES is to be solved. * @param msg the message that should be signed. * @return Y_ the modified document needed for solving LES, (Y_ = * A1^{-1}*(Y-b1)) linear map L1 = A1 x + b1. */ private short[] initSign(Layer[] layer, short[] msg) { /* preparation: Modifies the document with the inverse of L1 */ // tmp = Y - b1: short[] tmpVec = new short[msg.length]; tmpVec = cf.addVect(((RainbowPrivateKeyParameters)this.key).getB1(), msg); // Y_ = A1^{-1} * (Y - b1) : short[] Y_ = cf.multiplyMatrix(((RainbowPrivateKeyParameters)this.key).getInvA1(), tmpVec); /* generates the vinegar vars of the first layer at random */ for (int i = 0; i < layer[0].getVi(); i++) { x[i] = (short)random.nextInt(); x[i] = (short)(x[i] & GF2Field.MASK); } return Y_; }
this.A1 = new short[dim][dim]; this.A1inv = null; ComputeInField c = new ComputeInField(); A1inv = c.inverse(A1);
computeZerosUnder(false); // obtain zeros under the diagonal substitute();
this.A2 = new short[dim][dim]; this.A2inv = null; ComputeInField c = new ComputeInField(); this.A2inv = c.inverse(A2);
this.A2 = new short[dim][dim]; this.A2inv = null; ComputeInField c = new ComputeInField(); this.A2inv = c.inverse(A2);