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.
17 * CBC mode encryptor and decryptor implementation
34 * Concrete subclass of CBlockChainingMode implementing CBC mode block chaining
38 class CModeCBCEncryptor : public CBlockChainingMode
42 * Creates an object of this class for CBC mode encryption.
44 * @param aBT An appropriate CBlockTransformation derived encryptor.
45 * @param aIV Initialization vector, the length of this descriptor must be
46 * the same as the underlying cipher's block size.
47 * @return A pointer to the new CModeCBCEncryptor object
49 IMPORT_C static CModeCBCEncryptor* NewL(CBlockTransformation* aBT,
53 * Creates an object of this class for CBC mode encryption.
55 * The returned pointer is put onto the cleanup stack.
57 * @param aBT An appropriate CBlockTransformation derived encryptor.
58 * @param aIV Initialization vector, the length of this descriptor must be
59 * the same as the underlying cipher's block size.
60 * @return A pointer to the new CModeCBCEncryptor object
62 IMPORT_C static CModeCBCEncryptor* NewLC(CBlockTransformation* aBT,
64 virtual void Transform(TDes8& aBlock);
71 const CModeCBCEncryptor& operator=(const CModeCBCEncryptor&);
75 * Concrete subclass of CBlockChainingMode implementing CBC mode block chaining
79 class CModeCBCDecryptor : public CBlockChainingMode
83 * Creates an object of this class for CBC mode decryption.
85 * @param aBT An appropriate CBlockTransformation derived decryptor.
86 * @param aIV Initialization vector, the length of this descriptor must be
87 * the same as the underlying cipher's block size.
88 * @return A pointer to the CModeCBCDecryptor new object.
90 IMPORT_C static CModeCBCDecryptor* NewL(CBlockTransformation* aBT,
94 * Creates an object of this class for CBC mode decryption.
96 * The returned pointer is put onto the cleanup stack.
98 * @param aBT An appropriate CBlockTransformation derived decryptor.
99 * @param aIV Initialization vector, the length of this descriptor must be
100 * the same as the underlying cipher's block size.
101 * @return A pointer to the CModeCBCDecryptor new object.
103 IMPORT_C static CModeCBCDecryptor* NewLC(CBlockTransformation* aBT,
105 virtual ~CModeCBCDecryptor(void);
107 virtual void Transform(TDes8& aBlock);
112 void ConstructL(CBlockTransformation* aBT, const TDesC8& aIV);
117 const CModeCBCDecryptor& operator=(const CModeCBCDecryptor&);
120 #endif // __CBCMODE_H__