On Factoring Integers and Evaluating Discrete Logarithms