Update contrib.
2 * Copyright (c) 2006-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.
19 #ifndef __CBCMODESHIM_H__
20 #define __CBCMODESHIM_H__
32 class CSymmetricCipher;
36 CBC mode encryptor shim class that delegates all work to CModeCBCEncryptor.
37 This should only be instantiated by CModeCBCEncryptor::NewLC
39 NONSHARABLE_CLASS(CModeCBCEncryptorShim) : public CModeCBCEncryptor
43 Creates a new CModeCBCEncryptorShim. If the block transfer
44 @param aBT A pointer to the block transform object.
45 @param aIV The initialisation vector to use.
46 @return A pointer to a CModeCBCEncryptorShim instance or NULL if the block transform
47 does not support SPI or the SPI plug-in does not support CBC mode
49 static CModeCBCEncryptorShim* NewL(CBlockTransformation* aBT, const TDesC8& aIV);
52 TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
54 // From CBlockTransformation
56 TInt BlockSize() const;
58 void Transform(TDes8& aBlock);
60 // From CBlockChainingMode
61 void SetIV(const TDesC8& aIv);
65 CModeCBCEncryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
67 // Just invokes ContructL in super-class
68 void ConstructL(CBlockTransformation* aBT, const TDesC8& aIv);
70 // owned by block transform - iBT
71 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
75 CBC mode decryptor shim class that delegates all work to CModeCBCDecryptor.
76 This should only be instantiated by CModeCBCDecryptor::NewLC
78 NONSHARABLE_CLASS(CModeCBCDecryptorShim) : public CModeCBCDecryptor
82 Creates a new CModeCBCEncryptorShim.
83 @param aBT A pointer to the block transform object.
84 @param aIV The initialisation vector to use.
85 @return A pointer to a CModeCBCDecryptorShim instance or NULL if the block transform
86 does not support SPI or the SPI plug-in does not support CBC mode
88 static CModeCBCDecryptorShim* NewL(CBlockTransformation* aBT, const TDesC8& aIV);
91 TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
93 // From CBlockTransformation
95 TInt BlockSize() const;
97 void Transform(TDes8& aBlock);
99 // From CBlockChainingMode
100 void SetIV(const TDesC8& aIv);
104 CModeCBCDecryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
106 // Just invokes ContructL in super-class
107 void ConstructL(CBlockTransformation* aBT, const TDesC8& aIv);
109 // owned by block transform - iBT
110 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
113 #endif // __CBCMODESHIM_H__