CBlockChainingMode Class Reference

class CBlockChainingMode : public CBlockTransformation

Abstract class defining the use of block transformation objects as block chaining modes.

It is initialised with a subclass of CBlockTransformation, which it subsequently owns. Calls to its Transform() function will call the Transform() function in the underlying CBlockTransformation object, and perform the additional transformation for block chaining in that mode. This all means that if you want to do, say, AES encryption in CBC mode, you need to construct a CAESEncryptor object, then pass it to the CModeCBCEncryptor subclass of CBlockChainingMode, and subsequently use the CModeCBCEncryptor object to call Transform().

Inherits from

Constructor & Destructor Documentation

CBlockChainingMode()

IMPORT_CCBlockChainingMode()[protected]

Default constructor

~CBlockChainingMode()

IMPORT_C~CBlockChainingMode()[protected, virtual]

The destructor frees all resources owned by the object, prior to its destruction.

Member Functions Documentation

BlockSize()

TInt BlockSize()const [virtual]

Gets the block size in bytes.

ConstructL(CBlockTransformation *, const TDesC8 &)

IMPORT_C voidConstructL(CBlockTransformation *aBT,
const TDesC8 &aIV
)[protected]

Second phase constructor

This should be called last by derived classes' ContructL()s .

Parameters

CBlockTransformation * aBTA block transformation object
const TDesC8 & aIVInitialization vector, the length of this descriptor must be the same as the underlying cipher's block size.

KeySize()

TInt KeySize()const [virtual]

Gets the key size in bits.

Reset()

voidReset()[virtual]

Resets the transformation back to its original state. Clears all its buffers.

SetIV(const TDesC8 &)

voidSetIV(const TDesC8 &aIV)[virtual]

Sets the initialization vector.

Parameters

const TDesC8 & aIVThe initialization vector. The length of this descriptor must be the same as the underlying cipher's block size.

Member Data Documentation

CBlockTransformation * iBT

CBlockTransformation *iBT[protected]

A block transformation object

TPtr8 iIV

TPtr8 iIV[protected]

Encapsulates a pointer to iIVBuf

HBufC8 * iIVBuf

HBufC8 *iIVBuf[protected]

A buffer containing the Initialisation Vector (IV)

This must equal the underlying cipher's block size in length.

TPtr8 iRegister

TPtr8 iRegister[protected]

Encapsulates a pointer to iRegisterBuf

HBufC8 * iRegisterBuf

HBufC8 *iRegisterBuf[protected]

A buffer containing the feedback register

This must equal the underlying cipher's block size in length. Initially this register is filled with the initialization vector.