private BigInteger getSmalld(LucPublicKey key) { var lcm = (long)GetLcm(); BigInteger e = BigInteger.ModPow(key.e, (int)(lcm.Eyler() - 1), lcm); return(e); }
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); }
public LucPrivateKey(LucPublicKey publicKey, LegendreNumbers legendreNumbers) { d = BigInteger.ModPow(publicKey.e, (int)(legendreNumbers.Sn.Eyler() - 1), legendreNumbers.Sn); N = publicKey.N; }