/** * @deprecated Will be removed */ public X9FieldElement(int m, int k1, int k2, int k3, ASN1OctetString s) { this(new ECFieldElement.F2m(m, k1, k2, k3, new BigInteger(1, s.getOctets()))); }
public X9FieldElement(int m, int k1, int k2, int k3, ASN1OctetString s) { this(new ECFieldElement.F2m(m, k1, k2, k3, new BigInteger(1, s.getOctets()))); }
public ECFieldElement fromBigInteger(BigInteger x) { return new ECFieldElement.F2m(this.m, this.k1, this.k2, this.k3, x); }
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y) { LongArray ax = this.x, xx = ((F2m)x).x, yx = ((F2m)y).x; LongArray aa = ax.square(m, ks); LongArray xy = xx.multiply(yx, m, ks); if (aa == ax) { aa = (LongArray)aa.clone(); } aa.addShiftedByWords(xy, 0); aa.reduce(m, ks); return new F2m(m, ks, aa); }
public ECFieldElement square() { return new F2m(m, ks, x.modSquare(m, ks)); }
public ECFieldElement squarePow(int pow) { return pow < 1 ? this : new F2m(m, ks, x.modSquareN(pow, m, ks)); }
public ECFieldElement square() { return new F2m(m, ks, x.modSquare(m, ks)); }
public ECFieldElement invert() { return new ECFieldElement.F2m(this.m, this.ks, this.x.modInverse(m, ks)); }
public ECFieldElement addOne() { return new F2m(m, ks, x.addOne()); }
public ECFieldElement addOne() { return new F2m(m, ks, x.addOne()); }
public ECFieldElement fromBigInteger(BigInteger x) { return new ECFieldElement.F2m(this.m, this.k1, this.k2, this.k3, x); }
public ECFieldElement invert() { return new ECFieldElement.F2m(this.m, this.ks, this.x.modInverse(m, ks)); }
public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) { LongArray ax = this.x, bx = ((F2m)b).x, xx = ((F2m)x).x, yx = ((F2m)y).x; LongArray ab = ax.multiply(bx, m, ks); LongArray xy = xx.multiply(yx, m, ks); if (ab == ax || ab == bx) { ab = (LongArray)ab.clone(); } ab.addShiftedByWords(xy, 0); ab.reduce(m, ks); return new F2m(m, ks, ab); }
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y) { LongArray ax = this.x, xx = ((F2m)x).x, yx = ((F2m)y).x; LongArray aa = ax.square(m, ks); LongArray xy = xx.multiply(yx, m, ks); if (aa == ax) { aa = (LongArray)aa.clone(); } aa.addShiftedByWords(xy, 0); aa.reduce(m, ks); return new F2m(m, ks, aa); }
public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) { LongArray ax = this.x, bx = ((F2m)b).x, xx = ((F2m)x).x, yx = ((F2m)y).x; LongArray ab = ax.multiply(bx, m, ks); LongArray xy = xx.multiply(yx, m, ks); if (ab == ax || ab == bx) { ab = (LongArray)ab.clone(); } ab.addShiftedByWords(xy, 0); ab.reduce(m, ks); return new F2m(m, ks, ab); }
public ECFieldElement sqrt() { LongArray x1 = this.x; if (x1.isOne() || x1.isZero()) { return this; } LongArray x2 = x1.modSquareN(m - 1, m, ks); return new ECFieldElement.F2m(m, ks, x2); }
public ECFieldElement multiply(final ECFieldElement b) { // Right-to-left comb multiplication in the LongArray // Input: Binary polynomials a(z) and b(z) of degree at most m-1 // Output: c(z) = a(z) * b(z) mod f(z) // No check performed here for performance reasons. Instead the // elements involved are checked in ECPoint.F2m // checkFieldElements(this, b); return new F2m(m, ks, x.modMultiply(((F2m)b).x, m, ks)); }
public ECFieldElement add(final ECFieldElement b) { // No check performed here for performance reasons. Instead the // elements involved are checked in ECPoint.F2m // checkFieldElements(this, b); LongArray iarrClone = (LongArray)this.x.clone(); F2m bF2m = (F2m)b; iarrClone.addShiftedByWords(bF2m.x, 0); return new F2m(m, ks, iarrClone); }
public ECFieldElement add(final ECFieldElement b) { // No check performed here for performance reasons. Instead the // elements involved are checked in ECPoint.F2m // checkFieldElements(this, b); LongArray iarrClone = (LongArray)this.x.clone(); F2m bF2m = (F2m)b; iarrClone.addShiftedByWords(bF2m.x, 0); return new F2m(m, ks, iarrClone); }
public ECFieldElement multiply(final ECFieldElement b) { // Right-to-left comb multiplication in the LongArray // Input: Binary polynomials a(z) and b(z) of degree at most m-1 // Output: c(z) = a(z) * b(z) mod f(z) // No check performed here for performance reasons. Instead the // elements involved are checked in ECPoint.F2m // checkFieldElements(this, b); return new F2m(m, ks, x.modMultiply(((F2m)b).x, m, ks)); }