Pol  Revision:cb584c9
Pol::Crypt::TwoFish Class Reference

#include <twofish.h>

Public Member Functions

 TwoFish ()
 ~TwoFish ()
void Decrypt (unsigned char *in, unsigned char *out, int len)
void Init (unsigned char *gseed)

Public Attributes

unsigned char subData3 [256]

Protected Member Functions

void MakeKey (KeyInstance *key, unsigned char direction, int keyLen, char *keyMaterial)

Static Protected Member Functions

static void BlockEncrypt (CipherInstance *cipher, KeyInstance *key, unsigned char *input, int inputLen, unsigned char *outBuffer)
static void CipherInit (CipherInstance *cipher, unsigned char mode, char *IV)
static unsigned int F32 (unsigned int x, unsigned int *k32, int keyLen)
static void ReKey (KeyInstance *key)
static unsigned int RS_MDS_Encode (unsigned int k0, unsigned int k1)

Protected Attributes

CipherInstance ci
unsigned int dwIndex
KeyInstance ki
int numRounds [4]
int pos
unsigned int seed
int tabEnable
unsigned char tabUsed [256]

Detailed Description

Definition at line 36 of file twofish.h.

Constructor & Destructor Documentation

Pol::Crypt::TwoFish::TwoFish ( )

Definition at line 51 of file twofish.cpp.

References ci, ki, numRounds, subData3, and tabUsed.

Pol::Crypt::TwoFish::~TwoFish ( )

Definition at line 59 of file twofish.cpp.

Member Function Documentation

void Pol::Crypt::TwoFish::BlockEncrypt ( CipherInstance cipher,
KeyInstance key,
unsigned char *  input,
int  inputLen,
unsigned char *  outBuffer 
void Pol::Crypt::TwoFish::CipherInit ( CipherInstance cipher,
unsigned char  mode,
char *  IV 
void Pol::Crypt::TwoFish::Decrypt ( unsigned char *  in,
unsigned char *  out,
int  len 
unsigned int Pol::Crypt::TwoFish::F32 ( unsigned int  x,
unsigned int *  k32,
int  keyLen 

Definition at line 127 of file twofish.cpp.

References _b, Bswap, M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33, and p8.

Referenced by BlockEncrypt(), and ReKey().

void Pol::Crypt::TwoFish::Init ( unsigned char *  gseed)
void Pol::Crypt::TwoFish::MakeKey ( KeyInstance key,
unsigned char  direction,
int  keyLen,
char *  keyMaterial 
unsigned int Pol::Crypt::TwoFish::RS_MDS_Encode ( unsigned int  k0,
unsigned int  k1 

Definition at line 113 of file twofish.cpp.

References RS_rem.

Referenced by ReKey().

Member Data Documentation

CipherInstance Pol::Crypt::TwoFish::ci

Definition at line 61 of file twofish.h.

Referenced by Decrypt(), Init(), and TwoFish().

unsigned int Pol::Crypt::TwoFish::dwIndex

Definition at line 64 of file twofish.h.

Referenced by Init().

KeyInstance Pol::Crypt::TwoFish::ki

Definition at line 60 of file twofish.h.

Referenced by Decrypt(), Init(), and TwoFish().

int Pol::Crypt::TwoFish::numRounds[4]

Definition at line 67 of file twofish.h.

Referenced by Init(), MakeKey(), and TwoFish().

int Pol::Crypt::TwoFish::pos

Definition at line 66 of file twofish.h.

Referenced by Decrypt(), and Init().

unsigned int Pol::Crypt::TwoFish::seed

Definition at line 63 of file twofish.h.

Referenced by Init().

unsigned char Pol::Crypt::TwoFish::subData3[256]

Definition at line 49 of file twofish.h.

Referenced by Decrypt(), Init(), Pol::Crypt::CCryptTwofish::Init(), and TwoFish().

int Pol::Crypt::TwoFish::tabEnable

Definition at line 65 of file twofish.h.

Referenced by Init().

unsigned char Pol::Crypt::TwoFish::tabUsed[256]

Definition at line 62 of file twofish.h.

Referenced by TwoFish().

The documentation for this class was generated from the following files: