X-Git-Url: http://git.euphorik.ch/?p=crypto_lab3.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=8c4ec7e52bdeaa17bf7c4915b24a9e4d3df846d1;hp=3dcf71e303ca4c39517f714b1616c2430dd89a3f;hb=22aac262156e81085b22bdfcd0cc38950768be9b;hpb=2745bc6570ac32789650336b8c84a52d1883c62a diff --git a/src/main.cpp b/src/main.cpp index 3dcf71e..8c4ec7e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,9 +22,10 @@ void printUsage(const string& progName) cout << "Usage: " << progName << " " << endl; cout << " can be one of the following:" << endl; cout << " * tests: Do some tests for RSA and RSA-CRT" << endl; + cout << " * tests-with-shamirs-trick: Do some tests for RSA-CRT with Shamir's trick" << 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; + cout << " * attack-fixed: Try the attack with the Shamir's trick version" << endl; } int main(int argc, char** argv) @@ -35,10 +36,14 @@ int main(int argc, char** argv) if (args.size() >= 2 && args[1] == "tests") Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).runTests(); + else if (args.size() >= 2 && args[1] == "tests-with-shamirs-trick") + Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).runTestsWithShamirsTrick(); 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 if (args.size() >= 2 && args[1] == "attack-fixed") + Tests(KEY_SIZE_BITS, RSA_PUBLIC_EXPONENT).doAttackFixed(); else printUsage(args[0]);