Try skipping over the adding and just picking a new random number.
authorFelix Laurie von Massenbach <felix@erbridge.co.uk>
Tue, 27 May 2014 11:55:20 +0000 (12:55 +0100)
committerBen Laurie <ben@links.org>
Sun, 1 Jun 2014 14:31:26 +0000 (15:31 +0100)
commit982c42cb20f6a6797ea0ce5c5a8c1a040b170d65
treedca3621096bc190f754ae8e1621f1d92d7c0e9cc
parent7e965dcc3812ac6ec4d1413c5ea3224be6486c8f
Try skipping over the adding and just picking a new random number.

Generates a number coprime to 2, 3, 5, 7, 11.

Speed:
Trial div (add) : trial div (retry) : coprime
1 : 0.42 : 0.84
apps/speed.c
crypto/bn/bn_lcl.h
crypto/bn/bn_prime.c
tools/primes.py