Exemple #1
0
        public void getPrime()
        {
            var p = PseudoRandomPrimeNumber.GetRandomPrimeNumber2(24);
            var l = PseudoRandomPrimeNumber.IteratedBitcount(p);

            Assert.IsTrue(l / 8 == 3);
        }
Exemple #2
0
 public static void GetPublicKeyCompontents(out BigInteger p, out BigInteger q, out BigInteger k, out BigInteger g)
 {
     q = PseudoRandomPrimeNumber.GetRandomPrimeNumber2(160);
     GetP(q, PseudoRandomPrimeNumber.GetRandomEvenNumber2(q), out k, out p);
     g = (GetG(p, q));
 }
Exemple #3
0
        public void getEvenNumber()
        {
            var even = PseudoRandomPrimeNumber.GetRandomEvenNumber(PseudoRandomPrimeNumber.GetRandomPrimeNumber2(160));

            Assert.IsTrue(even.IsEven);
        }
Exemple #4
0
        public void GetPrimeNumber()
        {
            var randomNum = PseudoRandomPrimeNumber.GetRandomPrimeNumber2(512);

            Assert.IsTrue(PseudoRandomPrimeNumber.IsPrime(randomNum));
        }