/** * Creates a new PolynomialGF2n by cloning the given PolynomialGF2n <i>a</i>. * * @param a the PolynomialGF2n to clone */ public GF2nPolynomial(GF2nPolynomial a) { int i; coeff = new GF2nElement[a.size]; size = a.size; for (i = 0; i < size; i++) { coeff[i] = (GF2nElement)a.coeff[i].clone(); } }
/** * Creates a new PolynomialGF2n by cloning the given PolynomialGF2n <i>a</i>. * * @param a the PolynomialGF2n to clone */ public GF2nPolynomial(GF2nPolynomial a) { int i; coeff = new GF2nElement[a.size]; size = a.size; for (i = 0; i < size; i++) { coeff[i] = (GF2nElement)a.coeff[i].clone(); } }
/** * Creates a new PolynomialGF2n of size <i>deg</i> and elem as * coefficients. * * @param deg - * the maximum degree + 1 * @param elem - * a GF2nElement */ public GF2nPolynomial(int deg, GF2nElement elem) { size = deg; coeff = new GF2nElement[size]; for (int i = 0; i < size; i++) { coeff[i] = (GF2nElement)elem.clone(); } }
/** * Creates a new PolynomialGF2n of size <i>deg</i> and elem as * coefficients. * * @param deg - * the maximum degree + 1 * @param elem - * a GF2nElement */ public GF2nPolynomial(int deg, GF2nElement elem) { size = deg; coeff = new GF2nElement[size]; for (int i = 0; i < size; i++) { coeff[i] = (GF2nElement)elem.clone(); } }
/** * Sets the coefficient at <i>index</i> to <i>elem</i>. * * @param index the index * @param elem the GF2nElement to store as coefficient <i>index</i> */ public final void set(int index, GF2nElement elem) { if (!(elem instanceof GF2nPolynomialElement) && !(elem instanceof GF2nONBElement)) { throw new IllegalArgumentException( "PolynomialGF2n.set f must be an " + "instance of either GF2nPolynomialElement or GF2nONBElement!"); } coeff[index] = (GF2nElement)elem.clone(); }
/** * Sets the coefficient at <i>index</i> to <i>elem</i>. * * @param index the index * @param elem the GF2nElement to store as coefficient <i>index</i> */ public final void set(int index, GF2nElement elem) { if (!(elem instanceof GF2nPolynomialElement) && !(elem instanceof GF2nONBElement)) { throw new IllegalArgumentException( "PolynomialGF2n.set f must be an " + "instance of either GF2nPolynomialElement or GF2nONBElement!"); } coeff[index] = (GF2nElement)elem.clone(); }
gamma[0] = (GF2nElement)u.clone(); for (i = 1; i < mDegree; i++)
gamma[0] = (GF2nElement)u.clone(); for (i = 1; i < mDegree; i++)
m = (GF2nElement)n.clone(); for (int j = 1; j <= k; j++)
m = (GF2nElement)n.clone(); for (int j = 1; j <= k; j++)
a = a.add(shift); a.shrink(); result[0].coeff[i] = (GF2nElement)factor.clone(); i = a.getDegree() - bDegree;
a = a.add(shift); a.shrink(); result[0].coeff[i] = (GF2nElement)factor.clone(); i = a.getDegree() - bDegree;