/* * Program to generate "trap-door primes". * Generates primes for use with "index" program * * Hard to find factors of the product of two of them n=p.q * - but easy to find discrete logs wrt p & q * See "Non-Interactive Public-Key Cryptography", Maurer & Yacobi * Eurocrypt '91 * */ #include #include "miracl.h" #define NPRIMES 6 /* =9 for > 256 bit primes */ #define PROOT 2 int main() { /* program to find a trap-door prime */ BOOL found; int i,spins; long seed; big pp[NPRIMES],q,p,t; FILE *fp; mirsys(50,0); for (i=0;i