예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
 public static EllipticCurvePoint calculateMasterKey(BigInteger prk, EllipticCurvePoint theirPublicKey, EllipticCurve curve)
 {
     return(PointAddition.addPoints(curve, theirPublicKey, PointMultiplication.multiplyPoint(prk, curve.G, curve)));
 }