|
Pol
Rev 533
|
#include <twofish.h>
Collaboration diagram for TwoFish: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 | BlockEncrypt (CipherInstance *cipher, KeyInstance *key, unsigned char *input, int inputLen, unsigned char *outBuffer) |
| void | CipherInit (CipherInstance *cipher, unsigned char mode, char *IV) |
| unsigned int | F32 (unsigned int x, unsigned int *k32, int keyLen) |
| void | MakeKey (KeyInstance *key, unsigned char direction, int keyLen, char *keyMaterial) |
| void | ReKey (KeyInstance *key) |
| 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] |
| TwoFish::TwoFish | ( | ) |
Definition at line 81 of file twofish.cpp.
Definition at line 84 of file twofish.cpp.
| void TwoFish::BlockEncrypt | ( | CipherInstance * | cipher, |
| KeyInstance * | key, | ||
| unsigned char * | input, | ||
| int | inputLen, | ||
| unsigned char * | outBuffer | ||
| ) | [protected] |
Definition at line 237 of file twofish.cpp.
References Bswap, F32(), tagcipherInstance::IV, tagcipherInstance::iv32, tagkeyInstance::keyLen, tagcipherInstance::mode, tagkeyInstance::numRounds, ROL, ROR, tagkeyInstance::sboxKeys, tagkeyInstance::subKeys, and x.
Referenced by Decrypt(), and Init().
Here is the call graph for this function:
Here is the caller graph for this function:| void TwoFish::CipherInit | ( | CipherInstance * | cipher, |
| unsigned char | mode, | ||
| char * | IV | ||
| ) | [protected] |
Definition at line 210 of file twofish.cpp.
References Bswap, tagcipherInstance::cipherSig, tagcipherInstance::IV, tagcipherInstance::iv32, and tagcipherInstance::mode.
Referenced by Init().
Here is the caller graph for this function:| void TwoFish::Decrypt | ( | unsigned char * | in, |
| unsigned char * | out, | ||
| int | len | ||
| ) |
Definition at line 121 of file twofish.cpp.
References BlockEncrypt(), ci, ki, pos, and subData3.
Referenced by CCryptBlowfishTwofish::Decrypt(), and CCryptTwofish::Decrypt().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned int TwoFish::F32 | ( | unsigned int | x, |
| unsigned int * | k32, | ||
| int | keyLen | ||
| ) | [protected] |
| void TwoFish::Init | ( | unsigned char * | gseed | ) |
Definition at line 90 of file twofish.cpp.
References BlockEncrypt(), ci, CipherInit(), dwIndex, tagkeyInstance::key32, ki, MakeKey(), numRounds, pos, ReKey(), seed, subData3, and tabEnable.
Referenced by CCryptBlowfishTwofish::Init(), and CCryptTwofish::Init().
Here is the call graph for this function:
Here is the caller graph for this function:| void TwoFish::MakeKey | ( | KeyInstance * | key, |
| unsigned char | direction, | ||
| int | keyLen, | ||
| char * | keyMaterial | ||
| ) | [protected] |
Definition at line 223 of file twofish.cpp.
References tagkeyInstance::direction, tagkeyInstance::key32, tagkeyInstance::keyLen, tagkeyInstance::keyMaterial, tagkeyInstance::keySig, tagkeyInstance::numRounds, and numRounds.
Referenced by Init().
Here is the caller graph for this function:| void TwoFish::ReKey | ( | KeyInstance * | key | ) | [protected] |
Definition at line 184 of file twofish.cpp.
References F32(), tagkeyInstance::key32, tagkeyInstance::keyLen, tagkeyInstance::numRounds, ROL, RS_MDS_Encode(), tagkeyInstance::sboxKeys, and tagkeyInstance::subKeys.
Referenced by Init().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned int TwoFish::RS_MDS_Encode | ( | unsigned int | k0, |
| unsigned int | k1 | ||
| ) | [protected] |
Definition at line 140 of file twofish.cpp.
References RS_rem.
Referenced by ReKey().
Here is the caller graph for this function:CipherInstance TwoFish::ci [protected] |
unsigned int TwoFish::dwIndex [protected] |
KeyInstance TwoFish::ki [protected] |
int TwoFish::numRounds[4] [protected] |
int TwoFish::pos [protected] |
unsigned int TwoFish::seed [protected] |
| unsigned char TwoFish::subData3[256] |
Definition at line 49 of file twofish.h.
Referenced by Decrypt(), Init(), and CCryptTwofish::Init().
int TwoFish::tabEnable [protected] |
unsigned char TwoFish::tabUsed[256] [protected] |