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)); }
public CurvePoint Multiply(CurvePoint point) { return(point.Multiply(PrivateKey)); }
public Party(CurvePoint generator) { Generator = generator; PrivateKey = BigInteger.Remainder(Core.RandomService.Generate(Configurations.MathConfiguration.KeyBitLength), generator.Order); PublicKey = generator.Multiply(PrivateKey); }