/** * Creates a new GF2nPolynomialElement by cloning this * GF2nPolynomialElement. * * @return a copy of this element */ public Object clone() { return new GF2nPolynomialElement(this); }
/** * Creates a new GF2nPolynomialElement by cloning this * GF2nPolynomialElement. * * @return a copy of this element */ public Object clone() { return new GF2nPolynomialElement(this); }
/** * Compute the square root of this element and return the result in a new * {@link GF2nPolynomialElement}. * * @return <tt>this<sup>1/2</sup></tt> (newly created) */ public GF2nElement squareRoot() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareRootThis(); return result; }
/** * Returns <tt>this</tt> element + 'one". * * @return <tt>this</tt> + 'one' */ public GF2nElement increase() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.increaseThis(); return result; }
/** * Returns <tt>this</tt> element + 'one". * * @return <tt>this</tt> + 'one' */ public GF2nElement increase() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.increaseThis(); return result; }
/** * Compute the square root of this element and return the result in a new * {@link GF2nPolynomialElement}. * * @return <tt>this<sup>1/2</sup></tt> (newly created) */ public GF2nElement squareRoot() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareRootThis(); return result; }
/** * Compute the product of this element and <tt>factor</tt>. * * @param factor the factor * @return <tt>this * factor</tt> (newly created) * @throws DifferentFieldsException if the elements are of different fields. */ public GFElement multiply(GFElement factor) throws RuntimeException { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.multiplyThisBy(factor); return result; }
/** * Compute the sum of this element and <tt>addend</tt>. * * @param addend the addend * @return <tt>this + other</tt> (newly created) */ public GFElement add(GFElement addend) throws RuntimeException { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.addToThis(addend); return result; }
/** * Compute the product of this element and <tt>factor</tt>. * * @param factor the factor * @return <tt>this * factor</tt> (newly created) */ public GFElement multiply(GFElement factor) throws RuntimeException { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.multiplyThisBy(factor); return result; }
/** * Compute the sum of this element and <tt>addend</tt>. * * @param addend the addend * @return <tt>this + other</tt> (newly created) * @throws DifferentFieldsException if the elements are of different fields. */ public GFElement add(GFElement addend) throws RuntimeException { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.addToThis(addend); return result; }
/** * Create the one element. * * @param f the finite field * @return the one element in the given finite field */ public static GF2nPolynomialElement ONE(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree(), new int[]{1}); return new GF2nPolynomialElement(f, polynomial); }
/** * Create the zero element. * * @param f the finite field * @return the zero element in the given finite field */ public static GF2nPolynomialElement ZERO(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree()); return new GF2nPolynomialElement(f, polynomial); }
/** * Create the one element. * * @param f the finite field * @return the one element in the given finite field */ public static GF2nPolynomialElement ONE(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree(), new int[]{1}); return new GF2nPolynomialElement(f, polynomial); }
/** * Create the zero element. * * @param f the finite field * @return the zero element in the given finite field */ public static GF2nPolynomialElement ZERO(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree()); return new GF2nPolynomialElement(f, polynomial); }
/** * Squares this GF2nPolynomialElement by using precalculated values and * reducing. This is supposed to de fastest when using a trinomial or * pentanomial as field polynomial. Use squareMatrix when using a ordinary * polynomial as field polynomial. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2nPolynomialElement#squareMatrix * @see GF2Polynomial#squareThisPreCalc */ public GF2nPolynomialElement squarePreCalc() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisPreCalc(); result.reduceThis(); return result; }
/** * Squares this GF2nPolynomialElement using GF2nField's squaring matrix. * This is supposed to be fast when using a polynomial (no tri- or * pentanomial) as fieldpolynomial. Use squarePreCalc when using a tri- or * pentanomial as fieldpolynomial instead. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2Polynomial#vectorMult * @see GF2nPolynomialElement#squarePreCalc * @see GF2nPolynomialElement#squareBitwise */ public GF2nPolynomialElement squareMatrix() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisMatrix(); result.reduceThis(); return result; }
/** * Squares this GF2nPolynomialElement by shifting left its Bitstring and * reducing. This is supposed to be the slowest method. Use squarePreCalc or * squareMatrix instead. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2nPolynomialElement#squareMatrix * @see GF2nPolynomialElement#squarePreCalc * @see GF2Polynomial#squareThisBitwise */ public GF2nPolynomialElement squareBitwise() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisBitwise(); result.reduceThis(); return result; }
/** * Squares this GF2nPolynomialElement by shifting left its Bitstring and * reducing. This is supposed to be the slowest method. Use squarePreCalc or * squareMatrix instead. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2nPolynomialElement#squareMatrix * @see GF2nPolynomialElement#squarePreCalc * @see GF2Polynomial#squareThisBitwise */ public GF2nPolynomialElement squareBitwise() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisBitwise(); result.reduceThis(); return result; }
/** * Squares this GF2nPolynomialElement by using precalculated values and * reducing. This is supposed to de fastest when using a trinomial or * pentanomial as field polynomial. Use squareMatrix when using a ordinary * polynomial as field polynomial. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2nPolynomialElement#squareMatrix * @see GF2Polynomial#squareThisPreCalc */ public GF2nPolynomialElement squarePreCalc() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisPreCalc(); result.reduceThis(); return result; }
/** * Squares this GF2nPolynomialElement using GF2nField's squaring matrix. * This is supposed to be fast when using a polynomial (no tri- or * pentanomial) as fieldpolynomial. Use squarePreCalc when using a tri- or * pentanomial as fieldpolynomial instead. * * @return <tt>this<sup>2</sup></tt> (newly created) * @see GF2Polynomial#vectorMult * @see GF2nPolynomialElement#squarePreCalc * @see GF2nPolynomialElement#squareBitwise */ public GF2nPolynomialElement squareMatrix() { GF2nPolynomialElement result = new GF2nPolynomialElement(this); result.squareThisMatrix(); result.reduceThis(); return result; }