public Layer(int vi,int viNext,SecureRandom sr){
  this.vi=vi;
  this.viNext=viNext;
  this.oi=viNext - vi;
  this.coeff_alpha=new short[this.oi][this.oi][this.vi];
  this.coeff_beta=new short[this.oi][this.vi][this.vi];
  this.coeff_gamma=new short[this.oi][this.viNext];
  this.coeff_eta=new short[this.oi];
  int numOfPoly=this.oi;
  for (int k=0; k < numOfPoly; k++) {
    for (int i=0; i < this.oi; i++) {
      for (int j=0; j < this.vi; j++) {
        coeff_alpha[k][i][j]=(short)(sr.nextInt() & GF2Field.MASK);
      }
    }
  }
  for (int k=0; k < numOfPoly; k++) {
    for (int i=0; i < this.vi; i++) {
      for (int j=0; j < this.vi; j++) {
        coeff_beta[k][i][j]=(short)(sr.nextInt() & GF2Field.MASK);
      }
    }
  }
  for (int k=0; k < numOfPoly; k++) {
    for (int i=0; i < this.viNext; i++) {
      coeff_gamma[k][i]=(short)(sr.nextInt() & GF2Field.MASK);
    }
  }
  for (int k=0; k < numOfPoly; k++) {
    coeff_eta[k]=(short)(sr.nextInt() & GF2Field.MASK);
  }
}

public Layer ( int vi , int viNext , SecureRandom sr ) { this . vi = vi ; this . viNext = viNext ; this . oi = viNext - vi ; this . coeff_alpha = new short [ this . oi ] [ this . oi ] [ this . vi ] ; this . coeff_beta = new short [ this . oi ] [ this . vi ] [ this . vi ] ; this . coeff_gamma = new short [ this . oi ] [ this . viNext ] ; this . coeff_eta = new short [ this . oi ] ; int numOfPoly = this . oi ; for ( int k = 0 ; k < numOfPoly ; k ++ ) { for ( int i = 0 ; i < this . oi ; i ++ ) { for ( int j = 0 ; j < this . vi ; j ++ ) { coeff_alpha [ k ] [ i ] [ j ] = ( short ) ( sr . nextInt ( ) & GF2Field . MASK ) ; } } } for ( int k = 0 ; k < numOfPoly ; k ++ ) { for ( int i = 0 ; i < this . vi ; i ++ ) { for ( int j = 0 ; j < this . vi ; j ++ ) { coeff_beta [ k ] [ i ] [ j ] = ( short ) ( sr . nextInt ( ) & GF2Field . MASK ) ; } } } for ( int k = 0 ; k < numOfPoly ; k ++ ) { for ( int i = 0 ; i < this . viNext ; i ++ ) { coeff_gamma [ k ] [ i ] = ( short ) ( sr . nextInt ( ) & GF2Field . MASK ) ; } } for ( int k = 0 ; k < numOfPoly ; k ++ ) { coeff_eta [ k ] = ( short ) ( sr . nextInt ( ) & GF2Field . MASK ) ; } }
this function generates the coefficients of all polynomials in this layer at random using random generator .
