proj home

Files   Classes   Functions   Hierarchy  

rsa.h

Go to the documentation of this file.
00001 #ifndef RSA_H
00002 #define RSA_H
00003 
00004 #include <cassert>
00005 #include <string>
00006 using namespace std;
00007 
00008 #include <NTL/ZZ.h>
00009 using namespace NTL;
00010 
00011 #include <primegen.h>
00012 #include <print.h>
00013 
00023 class rsaE
00024 {
00025 public:
00026 
00028   ZZ n;
00030   ZZ e;
00031 
00033   void operator() ( string & c, string const & m ) const;
00034 };
00035 
00036 
00037 
00045 class rsaD
00046 {
00048   ZZ d; 
00050   ZZ n; 
00051 public:
00052 
00054   ZZ p;
00056   ZZ q;
00058   ZZ e;
00059 
00061   void init();
00062 
00064   void operator() ( string & m, string const & c ) const;
00065 };
00066 
00077 class rsaGenKey
00078 {
00080   void finde();
00082   void blocksizecalc();
00084   largePrimeGenerator lpg;
00087   void genkey();
00088 public:
00089 
00091   rsaGenKey(uintc _nbits);
00093   rsaGenKey
00094   (
00095     uintc _nbits,
00096     string const & _p,
00097     string const & _q
00098   );
00099 
00101   uintc nbits;
00102 
00104   uint blocksize;
00105 
00107   ZZ p;
00109   ZZ q;
00111   ZZ e;
00113   ZZ n;
00115   ZZ n2;
00116 
00118   void print() const;
00119 
00120 };
00121 
00122 
00123 
00124 #endif
00125 
00126 

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