Exemplo n.º 1
0
        public void TestComputePrimeLengthForSecurityLevel()
        {
            // dominated by NFS
            var l = MultiplicativeGroupAlgebra.ComputePrimeLengthForSecurityLevel(100);
            var p = BigPrime.CreateWithoutChecks(BigInteger.One << (l.InBits - 1));
            var s = MultiplicativeGroupAlgebra.ComputeSecurityLevel(p, p);

            Assert.AreEqual(100, s);

            // dominated by Pollard Rho
            l = MultiplicativeGroupAlgebra.ComputePrimeLengthForSecurityLevel(1);
            Assert.AreEqual(2, l.InBits);
        }