os/security/cryptoplugins/cryptospiplugins/test/h4drv/crypto_h4_plugin/rijndaelimpl.h
Update contrib.
2 * Copyright (c) 2007-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.
24 #ifndef __RIJNDAELIMPL_H__
25 #define __RIJNDAELIMPL_H__
29 #include "h4cipherimpl.h"
30 #include "cryptodriver.h"
33 Plug-in class for AES (Rijndael) block cipher
37 class __NOTSHARED CH4RijndaelImpl : public CH4CipherImpl
42 Creates an instance of an AES (Rijndael) symmetric cipher plug-in.
44 @param aCryptoMode Whether to encrypt or decrypt
45 @param aOperationMode The block cipher mode ECB, CBC, CTR etc
46 @param aPadding The padding scheme to use None, SSLv3, PKCS#7
47 @return A pointer to a CH4RijndaelImpl instance
49 static CH4RijndaelImpl* NewL(const CryptoSpi::CKey& aKey,
50 TUid aCryptoMode, TUid aOperationMode, TUid aPadding);
53 Creates an instance of an AES (Rijndael) symmetric cipher plug-in.
54 A pointer to the plug-in instance is placed on the cleanup stack.
56 @param aCryptoMode Whether to encrypt or decrypt
57 @param aOperationMode The block cipher mode ECB, CBC, CTR etc
58 @param aPadding The padding scheme to use None, SSLv3, PKCS#7
59 @return A pointer to a CH4RijndaelImpl instance
61 static CH4RijndaelImpl* NewLC(const CryptoSpi::CKey& aKey,
62 TUid aCryptoMode, TUid aOperationMode, TUid aPadding);
64 // From CSymmetricCipherImpl
65 TBool IsValidKeyLength(TInt aKeyBytes) const;
66 TUid ImplementationUid() const;
68 const CExtendedCharacteristics* GetExtendedCharacteristicsL();
70 static CExtendedCharacteristics* StaticGetExtendedCharacteristicsL();
78 @param aOperationMode The mode of operation e.g. CBC
79 @param aCryptoMode Whether to encrypt or decrypt
80 @param aPaddingMode The padding mode to use. None, SSL, PKCS#7
82 CH4RijndaelImpl(TUid aOperationMode, TUid aCryptoMode, TUid aPaddingMode);
84 /// second phase of construction
85 void ConstructL(const CryptoSpi::CKey& aKey);
88 virtual void DoSetupL();
89 virtual void DoWriteL(const TUint8* aBuffer, TUint aNumBytes);
90 virtual void DoReadL(TDes8 &aBuffer, TUint32 aLength);
93 RCryptoDriver iDriver;
98 #endif //__RIJNDAELIMPL_H__