private static BigInteger CalcD(BigInteger m) => //var d = m - 1; //var sqrt = m.Sqrt(); //for (int i = 2; i <= sqrt; ++i) //{ // if ((m % i == 0) && (d % i == 0)) // { // d--; // i = 2; // } //} BigIntegerExtension.GetRandomPrime(m.GetByteCount(), (b) => b.SolovayStrassenTest(1000));
public ElGamalsEDS(int bytesCount) { P = BigIntegerExtension.GetRandomPrime(bytesCount, b => b.SolovayStrassenTest(1000)); G = BigIntegerExtension.GetGroupGenerator(P); }