public ECFieldElement squareMinusProduct(ECFieldElement x, ECFieldElement y) { return square().subtract(x.multiply(y)); }
public ECFieldElement squareMinusProduct(ECFieldElement x, ECFieldElement y) { return square().subtract(x.multiply(y)); }
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y) { return square().add(x.multiply(y)); }
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y) { return square().add(x.multiply(y)); }
public ECFieldElement getYCoord() { ECFieldElement X = x, L = y; if (this.isInfinity() || X.isZero()) { return L; } // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly ECFieldElement Y = L.add(X).multiply(X); ECFieldElement Z = zs[0]; if (!Z.isOne()) { Y = Y.divide(Z); } return Y; }
public ECFieldElement getYCoord() { ECFieldElement X = x, L = y; if (this.isInfinity() || X.isZero()) { return L; } // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly ECFieldElement Y = L.add(X).multiply(X); ECFieldElement Z = zs[0]; if (!Z.isOne()) { Y = Y.divide(Z); } return Y; }
public ECFieldElement getYCoord() { ECFieldElement X = x, L = y; if (this.isInfinity() || X.isZero()) { return L; } // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly ECFieldElement Y = L.add(X).multiply(X); ECFieldElement Z = zs[0]; if (!Z.isOne()) { Y = Y.divide(Z); } return Y; }
public ECFieldElement getYCoord() { ECFieldElement X = x, L = y; if (this.isInfinity() || X.isZero()) { return L; } // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly ECFieldElement Y = L.add(X).multiply(X); ECFieldElement Z = zs[0]; if (!Z.isOne()) { Y = Y.divide(Z); } return Y; }
public ECFieldElement getYCoord() { ECFieldElement X = x, L = y; if (this.isInfinity() || X.isZero()) { return L; } // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly ECFieldElement Y = L.add(X).multiply(X); ECFieldElement Z = zs[0]; if (!Z.isOne()) { Y = Y.divide(Z); } return Y; }
public ECPoint scaleY(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord(), getRawYCoord().multiply(scale), getRawZCoords(), this.withCompression); }
public ECPoint scaleX(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord().multiply(scale), getRawYCoord(), getRawZCoords(), this.withCompression); }
public ECPoint scaleX(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord().multiply(scale), getRawYCoord(), getRawZCoords(), this.withCompression); }
public ECPoint scaleY(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord(), getRawYCoord().multiply(scale), getRawZCoords(), this.withCompression); }
public static BigInteger y(ECCurve curve, BigInteger x) { // Andrey Jivsov https://www.ietf.org/archive/id/draft-jivsov-ecc-compact-05.txt. ECFieldElement X = curve.fromBigInteger(x); ECFieldElement rhs = X.square().add(curve.getA()).multiply(X).add(curve.getB()); // y' = sqrt( C(x) ), where y'>0 ECFieldElement yTilde = rhs.sqrt(); if (yTilde == null) { throw new IllegalArgumentException("invalid point compression"); } // y = min(y',p-y') BigInteger yT = yTilde.toBigInteger(); BigInteger yTn = yTilde.negate().toBigInteger(); BigInteger y = yT.compareTo(yTn) == -1 ? yT : yTn; return y; }