Celartem::BlockCipher Class Reference

#include <cel_crypt.h>

Inheritance diagram for Celartem::BlockCipher:

Inheritance graph
[legend]

List of all members.

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

Static Public Member Functions

static AutoPtr< BlockCiphercreate (const String &inCipherName)


Detailed Description

This class is an abstract class for encryption cipher classes.

Definition at line 20 of file cel_crypt.h.


Member Function Documentation

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 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 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 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:
inKey Pointer to a buffer which contains the key.
inKeyByteLength The size of the key in bytes.

virtual size_t Celartem::BlockCipher::getBlockLength (  )  const [pure virtual]

This method returns the block size.

Returns:
The block length of this cipher.

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:
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.

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:
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.

virtual AutoPtr<BlockCipher> Celartem::BlockCipher::duplicate (  )  const [pure virtual]

This method duplicates the instance.

Returns:
Pointer to the newly created BlockCipher instance.

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

This method creates a new instance of Cipher class.

Parameters:
inCipherName The name of the cipher.
This method currently accepts the following cipher names:
NameCipher
blowfishBlowfish.
Returns:
Pointer to the newly created Cipher instance.


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:15 2008.