Files Classes Functions Hierarchy
00001 #ifndef PRIMEGEN_H 00002 #define PRIMEGEN_H 00003 00004 #include <NTL/ZZ.h> 00005 using namespace NTL; 00006 00007 #include <print.h> 00008 00021 class largePrimeGenerator 00022 { 00023 long int * v; 00024 uintc vmax; 00025 public: 00026 00028 largePrimeGenerator(); 00029 ~largePrimeGenerator(); 00030 00031 // Note findprime_randomly is faster than 00032 // findprime_sequentially in general. 00033 00034 /* Randomly choose large number, then sequentially search 00035 till a prime is encountered. */ 00036 void findprime_sequentially( ZZ & n, uintc nbits ) const; 00038 void findprime_randomly( ZZ & n, uintc nbits ) const; 00039 00041 bool const isprime( ZZ const & n ) const; 00042 00044 void ensurenbits( ZZ & n, uintc nbits ) const; 00045 }; 00046 00047 00048 00049 #endif 00050 00051
1.5.8