/** * Create a new GF2nONBElement by cloning this GF2nPolynomialElement. * * @return a copy of this element */ public Object clone() { return new GF2nONBElement(this); }
/** * Create a new GF2nONBElement by cloning this GF2nPolynomialElement. * * @return a copy of this element */ public Object clone() { return new GF2nONBElement(this); }
/** * returns <tt>this</tt> element to the power of 2. * * @return <tt>this</tt><sup>2</sup> */ public GF2nElement square() { GF2nONBElement result = new GF2nONBElement(this); result.squareThis(); return result; }
/** * returns <tt>this</tt> element + 1. * * @return <tt>this</tt> + 1 */ public GF2nElement increase() { GF2nONBElement result = new GF2nONBElement(this); result.increaseThis(); return result; }
/** * returns <tt>this</tt> element to the power of 2. * * @return <tt>this</tt><sup>2</sup> */ public GF2nElement square() { GF2nONBElement result = new GF2nONBElement(this); result.squareThis(); return result; }
/** * Create the zero element. * * @param gf2n the finite field * @return the zero element in the given finite field */ public static GF2nONBElement ZERO(GF2nONBField gf2n) { long[] polynomial = new long[gf2n.getONBLength()]; return new GF2nONBElement(gf2n, polynomial); }
/** * returns <tt>this</tt> element + 1. * * @return <tt>this</tt> + 1 */ public GF2nElement increase() { GF2nONBElement result = new GF2nONBElement(this); result.increaseThis(); return result; }
/** * Create the zero element. * * @param gf2n the finite field * @return the zero element in the given finite field */ public static GF2nONBElement ZERO(GF2nONBField gf2n) { long[] polynomial = new long[gf2n.getONBLength()]; return new GF2nONBElement(gf2n, polynomial); }
/** * returns the root of<tt>this</tt> element. * * @return <tt>this</tt><sup>1/2</sup> */ public GF2nElement squareRoot() { GF2nONBElement result = new GF2nONBElement(this); result.squareRootThis(); return result; }
/** * returns the root of<tt>this</tt> element. * * @return <tt>this</tt><sup>1/2</sup> */ public GF2nElement squareRoot() { GF2nONBElement result = new GF2nONBElement(this); result.squareRootThis(); 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 { GF2nONBElement result = new GF2nONBElement(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 { GF2nONBElement result = new GF2nONBElement(this); result.multiplyThisBy(factor); return result; }
/** * Compute the multiplicative inverse of this element. * * @return <tt>this<sup>-1</sup></tt> (newly created) * @throws ArithmeticException if <tt>this</tt> is the zero element. */ public GFElement invert() throws ArithmeticException { GF2nONBElement result = new GF2nONBElement(this); result.invertThis(); return result; }
/** * Compute the multiplicative inverse of this element. * * @return <tt>this<sup>-1</sup></tt> (newly created) * @throws ArithmeticException if <tt>this</tt> is the zero element. */ public GFElement invert() throws ArithmeticException { GF2nONBElement result = new GF2nONBElement(this); result.invertThis(); 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 { GF2nONBElement result = new GF2nONBElement(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 { GF2nONBElement result = new GF2nONBElement(this); result.addToThis(addend); return result; }
/** * Create the one element. * * @param gf2n the finite field * @return the one element in the given finite field */ public static GF2nONBElement ONE(GF2nONBField gf2n) { int mLength = gf2n.getONBLength(); long[] polynomial = new long[mLength]; // fill mDegree coefficients with one's for (int i = 0; i < mLength - 1; i++) { polynomial[i] = 0xffffffffffffffffL; } polynomial[mLength - 1] = mMaxmask[gf2n.getONBBit() - 1]; return new GF2nONBElement(gf2n, polynomial); }
/** * Create the one element. * * @param gf2n the finite field * @return the one element in the given finite field */ public static GF2nONBElement ONE(GF2nONBField gf2n) { int mLength = gf2n.getONBLength(); long[] polynomial = new long[mLength]; // fill mDegree coefficients with one's for (int i = 0; i < mLength - 1; i++) { polynomial[i] = 0xffffffffffffffffL; } polynomial[mLength - 1] = mMaxmask[gf2n.getONBBit() - 1]; return new GF2nONBElement(gf2n, polynomial); }
GF2nElement n = new GF2nONBElement(this);
GF2nElement n = new GF2nONBElement(this);