Application of sieve methods to factorization and the discrete logarithm problem