X-Git-Url: http://git.euphorik.ch/?p=crypto_lab3.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=3dcf71e303ca4c39517f714b1616c2430dd89a3f;hp=4cfdb9c6887434df844508da2d5e3097e15b4409;hb=2745bc6570ac32789650336b8c84a52d1883c62a;hpb=d061bc06b7e5681e9da4c2c0b7642f50d126ff76 diff --git a/src/main.cpp b/src/main.cpp index 4cfdb9c..3dcf71e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,15 +19,12 @@ const uint RSA_PUBLIC_EXPONENT = 65537; void printUsage(const string& progName) { - cout << "Usage: " << progName << " [tests|time-measures]" << endl; - -// mpz_class n = 10; -// mpz_class d = 3; -// mpz_class q; -// mpz_fdiv_q(q.get_mpz_t(), n.get_mpz_t(), d.get_mpz_t()); - -// cout << "q: " << q << endl; -// cout << "q: " << (n / d) << endl; + cout << "Usage: " << progName << " " << endl; + cout << " can be one of the following:" << endl; + cout << " * tests: Do some tests for RSA and RSA-CRT" << endl; + cout << " * time-measures: Compute the ratio between RSA and RSA-CRT" << endl; + cout << " * attack: Simulate the Boneh-DeMillo-Lipton attack against RSA-CRT" << endl; + cout << " * attack-fixed: [TODO]" << endl; } int main(int argc, char** argv) @@ -40,6 +37,8 @@ int main(int argc, char** argv) Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).runTests(); else if (args.size() >= 2 && args[1] == "time-measures") Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).runTimeMeasures(); + else if (args.size() >= 2 && args[1] == "attack") + Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).doAttack(); else printUsage(args[0]);