private static EllipticCurvePoint getPoint(BigInteger u1, BigInteger u2, EllipticCurvePoint publicKey, EllipticCurve theCurve) { EllipticCurvePoint GDependentPoint = PointMultiplication.multiplyPoint(u1, theCurve.G, theCurve); EllipticCurvePoint PublicKeyDependentPoint = PointMultiplication.multiplyPoint(u2, publicKey, theCurve); return(PointAddition.addPoints(theCurve, GDependentPoint, PublicKeyDependentPoint)); }
private static EllipticCurvePoint getResult(int[] bits, int index, EllipticCurve curve, EllipticCurvePoint auxPoint) { EllipticCurvePoint result = auxPoint; while (index < bits.Length) { auxPoint = PointDoubling.doublePoint(curve, auxPoint); if (bits[index] == 1) { result = PointAddition.addPoints(curve, result, auxPoint); } index++; } return(result); }
public static EllipticCurvePoint calculateMasterKey(BigInteger prk, EllipticCurvePoint theirPublicKey, EllipticCurve curve) { return(PointAddition.addPoints(curve, theirPublicKey, PointMultiplication.multiplyPoint(prk, curve.G, curve))); }