TLSharp.Core.MTProto.Crypto.Factorizator.Factorize C# (CSharp) Method

Factorize() public static method

public static Factorize ( TLSharp.Core.MTProto.Crypto.BigInteger pq ) : FactorizedPair
pq TLSharp.Core.MTProto.Crypto.BigInteger
return FactorizedPair
        public static FactorizedPair Factorize(BigInteger pq)
        {
            if (pq.BitLength < 64)
            {
                long pqlong = pq.LongValue;
                long divisor = findSmallMultiplierLopatin(pqlong);
                return new FactorizedPair(BigInteger.ValueOf(divisor), BigInteger.ValueOf(pqlong / divisor));
            }
            else {
                // TODO: port pollard factorization
                throw new InvalidOperationException("pq too long; TODO: port the pollard algo");
                // logger.error("pq too long; TODO: port the pollard algo");
                // return null;
            }
        }