#include <bcipherbase.h>
Inheritance diagram for BlockCipherBase:
Public Member Functions | |
BlockCipherBase () | |
Constructor; nothing special. | |
virtual | ~BlockCipherBase () |
Destructor: Must clean up the key data. | |
virtual const Parameters * | GetPar () const |
Returns a pointer to the (normally static) parameters of this block cipher. | |
virtual int | SetKey (char *key, size_t len) |
virtual int | CheckWeakKey () |
Checks if the currently set key is weak. | |
virtual int | CopyFrom (BlockCipherBase *bcb) |
Used to clone a block cipher (copy the keys). | |
virtual void | EncryptBlock (char *ibuf, char *obuf) |
virtual void | DecryptBlock (char *ibuf, char *obuf) |
Static Public Attributes | |
const Parameters | par |
Private Member Functions | |
BlockCipherBase (const BlockCipherBase &) | |
Do not use these:. | |
void | operator= (const BlockCipherBase &) |
If no derived class is used but this class itself, a null-cipher (which is not modifying the input) is used.
NOTE: This class is NOT "C++-safe" and you should generally be careful with cryptographic data, so it is best to manage (de)allocation of these objects in a higher order.
Definition at line 42 of file bcipherbase.h.
|
Do not use these:.
|
|
Constructor; nothing special.
Definition at line 68 of file bcipherbase.h. |
|
Destructor: Must clean up the key data.
Definition at line 70 of file bcipherbase.h. |
|
Checks if the currently set key is weak.
Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 43 of file bcipherbase.cc. |
|
Used to clone a block cipher (copy the keys). You have to cast bcb back to the derived class' type.
Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 67 of file bcipherbase.cc. References BlockCipherBase::Parameters::cipher_ID, GetPar(), and par. |
|
Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 58 of file bcipherbase.cc. References BLOCKSIZE. |
|
Encrypt/decrypt functions dealing with just one block of input.
Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 49 of file bcipherbase.cc. References BLOCKSIZE. |
|
Returns a pointer to the (normally static) parameters of this block cipher. The returned pointer may only be used in read-only manner. It may point to memory allocated by the cipher class as the pointer may not be used after the cipher class was destroyed. Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 81 of file bcipherbase.h. References par. Referenced by TwoFishCipher::CopyFrom(), BlowFishCipher::CopyFrom(), and CopyFrom(). |
|
|
|
Set key with specified size.
Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 34 of file bcipherbase.cc. References BlockCipherBase::Parameters::key_length, BlockCipherBase::Parameters::n_key_lengths, and par. |
|
Initial value: { INIT_FIELD(block_size) BLOCKSIZE, INIT_FIELD(n_key_lengths) 9, INIT_FIELD(key_length) null_par_kl, INIT_FIELD(cipher_ID) 0x0000, INIT_FIELD(name) "null" } Reimplemented in BlowFishCipher, and TwoFishCipher. Definition at line 24 of file bcipherbase.cc. Referenced by CopyFrom(), GetPar(), and SetKey(). |