#include <cel_crypt.h>
Public Member Functions | |
virtual const char * | getName () const =0 |
virtual size_t | getMinimumKeyByteLength () const =0 |
virtual size_t | getMaximumKeyByteLength () const =0 |
virtual void | init (const void *inKey, size_t inKeyByteLength)=0 |
virtual size_t | getBlockLength () const =0 |
virtual void | encrypt (void *CEL_RESTRICT outResult, const void *CEL_RESTRICT inData) const =0 |
virtual void | decrypt (void *CEL_RESTRICT outResult, const void *CEL_RESTRICT inData) const =0 |
virtual AutoPtr< BlockCipher > | duplicate () const =0 |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Static Public Member Functions | |
static AutoPtr< BlockCipher > | create (const String &inCipherName) |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
This class is an abstract class for encryption cipher classes.
|
static |
This method creates a new instance of Cipher class.
inCipherName | The name of the cipher. This method currently accepts the following cipher names:
|
|
pure virtual |
This method decrypts the input data.
This method must not update the internal state of the cipher instance since this class regards it as in ECB mode.
outResult | Pointer to the buffer which receives the descrypted result. The size of this buffer should be larger than the block length returned by getBlockLength method. |
inData | Pointer to the buffer which contains the encrypted data. Only the data of the block length is decrypted by a call to this method. |
|
pure virtual |
This method duplicates the instance.
|
pure virtual |
This method encrypts the input data.
This method must not update the internal state of the cipher instance since this class regards it as in ECB mode.
outResult | Pointer to the buffer which receives the encrypted result. The size of this buffer should be larger than the block length returned by getBlockLength method. |
inData | Pointer to the buffer which contains the plain data. Only the data of the block length is encrypted by a call to this method. |
|
pure virtual |
This method returns the block size.
|
pure virtual |
This method returns the maximum length of the key for the instance.
|
pure virtual |
This method returns the minimum length of the key for the instance.
|
pure virtual |
This method returns the name of this cipher.
|
pure virtual |
This method initializes the instance with the specified key.
If the key length is smaller than the length obtained by getMinimumKeyByteLength, this method automatically pads 0 to the end of the key binary. If the key length is larger than the length obtained by getMaximumKeyByteLength, this method simply cuts the trailing bytes.
inKey | Pointer to a buffer which contains the key. |
inKeyByteLength | The size of the key in bytes. |