#include <blowfishcipher.h>
Inheritance diagram for BlowFishCipher:
Public Member Functions | |
BlowFishCipher () | |
Construct a blowfish cipher; key must be set separately. | |
~BlowFishCipher () | |
Destructor: Cleans up the key data. | |
const Parameters * | GetPar () const |
Return pointer to static parameters. | |
int | SetKey (char *userkey, size_t len) |
Set the key for the following encryption/decryption. | |
int | CheckWeakKey () |
Check for weak blowfish key. | |
int | CopyFrom (BlockCipherBase *from) |
Copy the prepared keys from another BlowFishCipher. | |
void | EncryptBlock (char *ibuf, char *obuf) |
void | DecryptBlock (char *ibuf, char *obuf) |
Static Public Attributes | |
const BlockCipherBase::Parameters | par |
Parameters of the block cipher. | |
Private Member Functions | |
void | _EncryptRounds (uint32 *_yl, uint32 *_yr) |
void | _reset () |
Clean up the key data. | |
BlowFishCipher (const BlowFishCipher &) | |
Do not use these:. | |
void | operator= (const BlowFishCipher &) |
Private Attributes | |
uint32 | c_P [18] |
uint32 | c_S [1024] |
ADVANTAGE: FAST
Definition at line 55 of file blowfishcipher.h.
|
Do not use these:.
|
|
Construct a blowfish cipher; key must be set separately.
Definition at line 79 of file blowfishcipher.h. |
|
Destructor: Cleans up the key data.
Definition at line 81 of file blowfishcipher.h. References _reset(). |
|
For internal use only. Do the encryption. Definition at line 309 of file blowfishcipher.cc. References c_P, c_S, ROUND, and uint32. Referenced by SetKey(). |
|
Clean up the key data.
Definition at line 489 of file blowfishcipher.cc. References c_P, c_S, and uint32. Referenced by ~BlowFishCipher(). |
|
Check for weak blowfish key. Weak blowfish keys are generated with a probability of 1:2^14 (1:16384).
Reimplemented from BlockCipherBase. Definition at line 387 of file blowfishcipher.cc. |
|
Copy the prepared keys from another BlowFishCipher.
Reimplemented from BlockCipherBase. Definition at line 499 of file blowfishcipher.cc. References c_P, c_S, BlockCipherBase::Parameters::cipher_ID, BlockCipherBase::GetPar(), par, and uint32. |
|
Reimplemented from BlockCipherBase. Definition at line 457 of file blowfishcipher.cc. References c_P, c_S, INPACK, OUTPACK, ROUND, and uint32. Referenced by test_blowfish(). |
|
ibuf and obuf do not have to be aligned. Reimplemented from BlockCipherBase. Definition at line 424 of file blowfishcipher.cc. References c_P, c_S, INPACK, OUTPACK, ROUND, and uint32. Referenced by test_blowfish(). |
|
Return pointer to static parameters.
Reimplemented from BlockCipherBase. Definition at line 84 of file blowfishcipher.h. References par. |
|
|
|
Set the key for the following encryption/decryption. userkey must be 128 or 256 bits long (see BlockCipher::KeyLength()).
The key does not have to be aligned. Make sure, len is a value as returned by BlockCipher::KeyLength() or the functin fails.
Reimplemented from BlockCipherBase. Definition at line 335 of file blowfishcipher.cc. References _EncryptRounds(), bf_pbox, bf_sbox, c_P, c_S, and uint32. Referenced by test_blowfish(). |
|
Structure for an expanded blowfish key. Definition at line 64 of file blowfishcipher.h. Referenced by _EncryptRounds(), _reset(), CopyFrom(), DecryptBlock(), EncryptBlock(), and SetKey(). |
|
Definition at line 65 of file blowfishcipher.h. Referenced by _EncryptRounds(), _reset(), CheckWeakKey(), CopyFrom(), DecryptBlock(), EncryptBlock(), and SetKey(). |
|
Initial value: { INIT_FIELD(block_size) 8, INIT_FIELD(n_key_lengths) 7, INIT_FIELD(key_length) blowfish_par_kl, INIT_FIELD(cipher_ID) 0xBF15, INIT_FIELD(name) "blowfish" }
Reimplemented from BlockCipherBase. Definition at line 513 of file blowfishcipher.cc. Referenced by CopyFrom(), and GetPar(). |