Main Page | Namespace List | Data Structures | File List | Data Fields | Globals

nema.h

Go to the documentation of this file.
00001 #ifndef NEMA_H 
00002 #define NEMA_H
00003 
00011 using namespace std;
00012 
00013 #include <vector>
00014 #include <iostream>
00015 #include <fstream>
00016 #include <string>
00017 #include "cipher.h"
00018 
00020 class nzNema {
00021  private:
00023   int state[10];
00025   int steps;
00027   const int* notchRings[6];
00029   const int* rotors[4];
00031   const int* invrot[4];
00033   nzCipherText cipher;
00035   char flow(char charIn);
00037   void stepState();
00039   void printState();
00041   void setInnerKey();
00043   int getWheelOffset(int wheel);
00044 
00045  public:
00047   nzNema();
00049   nzNema(string passwd);
00051   string crypt(string strIn);
00053   string crypt(nzCipherText ctext) {return crypt(ctext.str());};
00055   double fastCrypt(string strIn);
00057   double fastCrypt(nzCipherText ctext) {return fastCrypt(ctext.str());};
00059   bool kpta(const string strPlain, const string strCipher);
00061   void initState(int init[10]);
00063   void initState(string passwd);
00065   double getUniformChi2() {return cipher.getUniformChi2();};
00066 };
00067 
00068 
00069 
00070 #endif
00071