public ECFieldElement divide(final ECFieldElement b) { // There may be more efficient implementations ECFieldElement bInv = b.invert(); return multiply(bInv); }
public ECFieldElement divide(final ECFieldElement b) { // There may be more efficient implementations ECFieldElement bInv = b.invert(); return multiply(bInv); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public ECFieldElement divide(ECFieldElement b) { return multiply(b.invert()); }
public static void montgomeryTrick(ECFieldElement[] zs, int off, int len, ECFieldElement scale) { /* * Uses the "Montgomery Trick" to invert many field elements, with only a single actual * field inversion. See e.g. the paper: * "Fast Multi-scalar Multiplication Methods on Elliptic Curves with Precomputation Strategy Using Montgomery Trick" * by Katsuyuki Okeya, Kouichi Sakurai. */ ECFieldElement[] c = new ECFieldElement[len]; c[0] = zs[off]; int i = 0; while (++i < len) { c[i] = c[i - 1].multiply(zs[off + i]); } --i; if (scale != null) { c[i] = c[i].multiply(scale); } ECFieldElement u = c[i].invert(); while (i > 0) { int j = off + i--; ECFieldElement tmp = zs[j]; zs[j] = c[i].multiply(u); u = u.multiply(tmp); } zs[off] = u; }
/** * Normalization ensures that any projective coordinate is 1, and therefore that the x, y * coordinates reflect those of the equivalent point in an affine coordinate system. * * @return a new ECPoint instance representing the same point, but with normalized coordinates */ public ECPoint normalize() { if (this.isInfinity()) { return this; } switch (this.getCurveCoordinateSystem()) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: { return this; } default: { ECFieldElement Z1 = getZCoord(0); if (Z1.isOne()) { return this; } return normalize(Z1.invert()); } } }
/** * Normalization ensures that any projective coordinate is 1, and therefore that the x, y * coordinates reflect those of the equivalent point in an affine coordinate system. * * @return a new ECPoint instance representing the same point, but with normalized coordinates */ public ECPoint normalize() { if (this.isInfinity()) { return this; } switch (this.getCurveCoordinateSystem()) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: { return this; } default: { ECFieldElement Z1 = getZCoord(0); if (Z1.isOne()) { return this; } return normalize(Z1.invert()); } } }
public static void montgomeryTrick(ECFieldElement[] zs, int off, int len, ECFieldElement scale) { /* * Uses the "Montgomery Trick" to invert many field elements, with only a single actual * field inversion. See e.g. the paper: * "Fast Multi-scalar Multiplication Methods on Elliptic Curves with Precomputation Strategy Using Montgomery Trick" * by Katsuyuki Okeya, Kouichi Sakurai. */ ECFieldElement[] c = new ECFieldElement[len]; c[0] = zs[off]; int i = 0; while (++i < len) { c[i] = c[i - 1].multiply(zs[off + i]); } --i; if (scale != null) { c[i] = c[i].multiply(scale); } ECFieldElement u = c[i].invert(); while (i > 0) { int j = off + i--; ECFieldElement tmp = zs[j]; zs[j] = c[i].multiply(u); u = u.multiply(tmp); } zs[off] = u; }
ECFieldElement beta = xp.square().invert().multiply(curve.getB()).add(curve.getA()).add(xp); ECFieldElement z = solveQuadraticEquation(curve, beta); if (z != null)
ECFieldElement beta = xp.square().invert().multiply(curve.getB()).add(curve.getA()).add(xp); ECFieldElement z = solveQuadraticEquation(curve, beta); if (z != null)
ECFieldElement beta = x.square().invert().multiply(this.getB()).add(this.getA()).add(x); ECFieldElement z = solveQuadraticEquation(beta); if (z != null)
ECFieldElement I = D.invert(); ECFieldElement L1 = d.multiply(I).multiply(Z); ECFieldElement L2 = X.square().multiply(I).subtract(L1);
ECFieldElement I = D.invert(); ECFieldElement L1 = d.multiply(I).multiply(Z); ECFieldElement L2 = X.square().multiply(I).subtract(L1);