예제 #1
0
        private void generateNumber()
        {
            BigInteger nr;

            do
            {
                nr = BigIntegerRandom.getRandom(SIZE, rnd);
            } while (!bigIntIsPrime(nr));
            prime = nr;
        }
예제 #2
0
        private BigInteger selectE(BigInteger fi)
        {
            BigInteger e;
            Random     rnd  = new Random();
            int        size = fi.ToString().Length;

            do
            {
                e = BigIntegerRandom.getRandom(size, rnd);
            } while (BigInteger.GreatestCommonDivisor(e, fi) != 1);
            return(e);
        }