Completed 1.2.5 and 1.2.6 (except Miller-Rabin)