#include #include #include #define KeySize 155 #define NumMessages 60 ln fast_exp(ln a, ln b, ln n); int main( int argc, char *argv[ ] ) { ln P; RandomPrime( &P, KeySize ); ln q = 1; for (long i = 0; i < NumMessages; i++) { while(1) { q = q + 2; while (!IsPrime(q)) q = q + 2; if (Jacobi(q,P) == -1) { cout << q << endl; break; } } } return 0; } ln fast_exp(ln a, ln b, ln n) { if ( a.IsZero() ) return (0); if ( b.IsZero() ) return(1); if ( b == 1 ) return(a%n); ln x = a*a % n; if (b.IsOdd()) return( a*fast_exp(x,b/2,n) % n ); return(fast_exp(x,b/2,n)); }