proj home

Files   Classes   Functions   Hierarchy  

main.cpp

Go to the documentation of this file.
00001 #include <cassert>
00002 #include <iostream>
00003 using namespace std;
00004 
00005 #include <NTL/ZZ.h>
00006 using namespace NTL;
00007 
00008 #include <commandline.h>
00009 #include <passwordverifier001test.h>
00010 #include <rsastate.h>
00011 #include <rsatest.h>
00012 
00013 
00014 int main(int argc, char** argv)
00015 {
00016   commandline cmd(argc,argv);
00017   uint prog(0);
00018   cmd.mapvar(prog,"prog");
00019 
00020   if (cmd.hastoken("rsa"))
00021   {
00022     rsastate s(argc,argv);
00023 
00024     return 0;
00025   }
00026 
00027   switch (prog)
00028   {
00029     case 0:
00030       cout << "To run the RSA encryption/decrytion program" << endl;
00031       cout << "./main rsa" <<  endl;
00032       cout << "Other programs." << endl;
00033 
00034       cout << "./main prog=1  - Small RSA example with maths library." << endl;
00035       cout << "./main prog=2  - Small RSA example with rsa classes." << endl;
00036       cout << "./main prog=3  - String and stream conversions written to files." << endl;
00037       cout << "./main prog=4  - Comparing sequential and random prime generation." << endl;
00038 
00039       break;
00040 
00041     case 1: return rsatest::unittest01(); 
00042     case 2: return rsatest::unittest02(); 
00043     case 3: rsatest::test01(); break;
00044     case 4: rsatest::test02(argc,argv); break;
00045 
00046     case 10: return passwordverifier001test::unittest01();
00047     case 11: passwordverifier001test::test02(); break;
00048 
00049     default: cout << "error:  No case handled." << endl; return 1;
00050   }
00051 
00052   return 0;
00053 }

Generated on Fri Mar 4 00:49:25 2011 for Chelton Evans Source by  doxygen 1.5.8