4cfdb9c6887434df844508da2d5e3097e15b4409
3 * It uses GMPxx lib and C++11.
4 * It needs the RNG file "/dev/urandom".
6 * Author: Grégory Burri
17 const uint KEY_SIZE_BITS
= 1024;
18 const uint RSA_PUBLIC_EXPONENT
= 65537;
20 void printUsage(const string
& progName
)
22 cout
<< "Usage: " << progName
<< " [tests|time-measures]" << endl
;
27 // mpz_fdiv_q(q.get_mpz_t(), n.get_mpz_t(), d.get_mpz_t());
29 // cout << "q: " << q << endl;
30 // cout << "q: " << (n / d) << endl;
33 int main(int argc
, char** argv
)
36 for (int i
= 0; i
< argc
; i
++)
37 args
.push_back(string(argv
[i
]));
39 if (args
.size() >= 2 && args
[1] == "tests")
40 Tests(KEY_SIZE_BITS
, RSA_PUBLIC_EXPONENT
).runTests();
41 else if (args
.size() >= 2 && args
[1] == "time-measures")
42 Tests(KEY_SIZE_BITS
, RSA_PUBLIC_EXPONENT
).runTimeMeasures();