First public contribution.
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * ** IMPORTANT ** PublishedPartner API's in this file are published to 3rd party developers via the
16 * Symbian website. Changes to these API's should be treated as PublishedAll API changes and the Security TA should be consulted.
30 #include <blocktransformation.h>
33 * Abstract class defining the use of block transformation objects as block
36 * It is initialised with a subclass of CBlockTransformation,
37 * which it subsequently owns. Calls to its Transform() function will call the
38 * Transform() function in the underlying CBlockTransformation object, and perform
39 * the additional transformation for block chaining in that mode. This all means
40 * that if you want to do, say, AES encryption in CBC mode, you need to construct
41 * a CAESEncryptor object, then pass it to the CModeCBCEncryptor subclass of
42 * CBlockChainingMode, and subsequently use the CModeCBCEncryptor object to call
48 class CBlockChainingMode : public CBlockTransformation
52 virtual TInt BlockSize() const;
53 virtual TInt KeySize() const;
56 * Sets the initialization vector.
58 * @param aIV The initialization vector. The length of this descriptor must be
59 * the same as the underlying cipher's block size.
61 virtual void SetIV(const TDesC8& aIV);
63 /** Default constructor */
64 IMPORT_C CBlockChainingMode();
66 * Second phase constructor
68 * This should be called last by derived classes' ContructL()s .
70 * @param aBT A block transformation object
71 * @param aIV Initialization vector, the length of this descriptor must be
72 * the same as the underlying cipher's block size.
74 IMPORT_C void ConstructL(CBlockTransformation* aBT, const TDesC8& aIV);
76 /** The destructor frees all resources owned by the object, prior to its destruction. */
77 IMPORT_C virtual ~CBlockChainingMode();
79 /** A block transformation object */
80 CBlockTransformation* iBT;
83 * A buffer containing the feedback register
85 * This must equal the underlying cipher's block size in length.
86 * Initially this register is filled with the initialization vector.
90 /** Encapsulates a pointer to iRegisterBuf */
94 * A buffer containing the Initialisation Vector (IV)
96 * This must equal the underlying cipher's block size in length.
100 /** Encapsulates a pointer to iIVBuf */