Public Member Functions | Static Public Member Functions | List of all members
Celartem::BlockCipher Class Referenceabstract

#include <cel_crypt.h>

Inheritance diagram for Celartem::BlockCipher:
Inheritance graph
[legend]

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< BlockCipherduplicate () 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< BlockCiphercreate (const String &inCipherName)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

This class is an abstract class for encryption cipher classes.

Member Function Documentation

static AutoPtr<BlockCipher> Celartem::BlockCipher::create ( const String inCipherName)
static

This method creates a new instance of Cipher class.

Parameters
inCipherNameThe name of the cipher.
This method currently accepts the following cipher names:
NameCipher
blowfishBlowfish.
Returns
Pointer to the newly created Cipher instance.
virtual void Celartem::BlockCipher::decrypt ( void *CEL_RESTRICT  outResult,
const void *CEL_RESTRICT  inData 
) const
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.

Parameters
outResultPointer to the buffer which receives the descrypted result.
The size of this buffer should be larger than the block length returned by getBlockLength method.
inDataPointer to the buffer which contains the encrypted data.
Only the data of the block length is decrypted by a call to this method.
virtual AutoPtr<BlockCipher> Celartem::BlockCipher::duplicate ( ) const
pure virtual

This method duplicates the instance.

Returns
Pointer to the newly created BlockCipher instance.
virtual void Celartem::BlockCipher::encrypt ( void *CEL_RESTRICT  outResult,
const void *CEL_RESTRICT  inData 
) const
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.

Parameters
outResultPointer to the buffer which receives the encrypted result.
The size of this buffer should be larger than the block length returned by getBlockLength method.
inDataPointer to the buffer which contains the plain data.
Only the data of the block length is encrypted by a call to this method.
virtual size_t Celartem::BlockCipher::getBlockLength ( ) const
pure virtual

This method returns the block size.

Returns
The block length of this cipher.
virtual size_t Celartem::BlockCipher::getMaximumKeyByteLength ( ) const
pure virtual

This method returns the maximum length of the key for the instance.

Returns
The maximum key "byte" length.
virtual size_t Celartem::BlockCipher::getMinimumKeyByteLength ( ) const
pure virtual

This method returns the minimum length of the key for the instance.

Returns
The minimum key "byte" length.
virtual const char* Celartem::BlockCipher::getName ( ) const
pure virtual

This method returns the name of this cipher.

Returns
The name of the cipher in UTF-8 encoded string.
virtual void Celartem::BlockCipher::init ( const void *  inKey,
size_t  inKeyByteLength 
)
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.

Parameters
inKeyPointer to a buffer which contains the key.
inKeyByteLengthThe size of the key in bytes.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo