makaveli713 / ECEC

El Gamal cryptography on an elliptic curve
0 stars 0 forks source link

Implement PointMultiplication method on EllipticCurve class #10

Closed makaveli713 closed 11 years ago

makaveli713 commented 11 years ago

use this algorithm: IMAG0899

makaveli713 commented 11 years ago

Remake this method like that:

public Point PointMultiplication(Point point, BigInteger n)
        {
            var newPoint = point;
            var nBits = Auxiliary.Math.GetBits(n);
            for (var i = 1; i < nBits.Length; i++)
            {
                newPoint = PointDoubling(newPoint);
                if (nBits[i] == 1)
                    newPoint = PointAddition(newPoint, point);
            }
            return newPoint;
        }

so right now it returns BigInteger

makaveli713 commented 11 years ago

При умножении точки P(x, y) на 0 мы должны получить точку в бесконечности R(0,0)

makaveli713 commented 11 years ago

При умножении точки P(x, y) на количество точек мы должны получить точку в бесконечности R(0,0)

makaveli713 commented 11 years ago

При умножении точки P(x, y) на -n (n>0) мы должны получить точку - (P+P+...+P)