Lenstra's algorithm for factoring large numbers.