예제 #1
0
        private BigInteger getSmalld(LucPublicKey key)
        {
            var lcm = (long)GetLcm();


            BigInteger e = BigInteger.ModPow(key.e, (int)(lcm.Eyler() - 1), lcm);

            return(e);
        }
예제 #2
0
        public LucKeyGenerator(LucPrime prime, BigInteger message)
        {
            P            = message;
            PrimeNumbers = prime;
            if (PrimeNumbers.N <= message)
            {
                throw new ArgumentException("N need to be greater than message");
            }
            PublicKey = new LucPublicKey(GenerateSimpleE(), PrimeNumbers.N);

            PrivateKey = new LucPrivateKey(getSmalld(PublicKey), PrimeNumbers.N);
        }
예제 #3
0
        public LucPrivateKey(LucPublicKey publicKey, LegendreNumbers legendreNumbers)
        {
            d = BigInteger.ModPow(publicKey.e, (int)(legendreNumbers.Sn.Eyler() - 1), legendreNumbers.Sn);

            N = publicKey.N;
        }