private BigInteger GetValueY(BigInteger x) { BigInteger value = GetYSquare(x); BigInteger y = BigIntigerMath.SqrtModEuler(value, modulo); return(y); }
public Point EncryptMessage(string massage, BigInteger ni) { byte[] bytes = System.Text.Encoding.UTF8.GetBytes(massage); BigInteger M = new BigInteger(bytes); for (int i = 1; i <= ni; i++) { BigInteger x = (M * ni + i) % modulo; BigInteger ySquare = (BigInteger.ModPow(x, 3, modulo) + x * A + B) % modulo; if (SquareRest.IsSquareRest(modulo, ySquare)) { BigInteger y = BigIntigerMath.SqrtModEuler(ySquare, modulo); return(new Point(x, y)); } } return(new Point(-1)); }