Example #1
0
        protected Tuple <CurvePoint, CurvePoint> Encrypt(Point message, CurvePoint publicKey)
        {
            var randomKey = BigInteger.Remainder(Core.RandomService.Generate(), Generator.Order);
            var c1        = Generator.Multiply(randomKey);
            var c2        = publicKey.Multiply(randomKey);

            c2.Add(message);

            return(new Tuple <CurvePoint, CurvePoint>(c1, c2));
        }
Example #2
0
 public CurvePoint Multiply(CurvePoint point)
 {
     return(point.Multiply(PrivateKey));
 }
Example #3
0
 public Party(CurvePoint generator)
 {
     Generator  = generator;
     PrivateKey = BigInteger.Remainder(Core.RandomService.Generate(Configurations.MathConfiguration.KeyBitLength), generator.Order);
     PublicKey  = generator.Multiply(PrivateKey);
 }