sl@0: /* sl@0: * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __CRYPTOTESTACTION_H__ sl@0: #define __CRYPTOTESTACTION_H__ sl@0: sl@0: #include "t_testaction.h" sl@0: #include "t_input.h" sl@0: sl@0: _LIT8(KVectorStart, ""); sl@0: _LIT8(KVectorEnd, ""); sl@0: _LIT8(KIncrementalStart, ""); sl@0: _LIT8(KIncrementalEnd, ""); sl@0: _LIT8(KKeyStart, ""); sl@0: _LIT8(KKeyEnd, ""); sl@0: _LIT8(KInputStart, ""); sl@0: _LIT8(KInputEnd, ""); sl@0: _LIT8(KOutputStart, ""); sl@0: _LIT8(KOutputEnd, ""); sl@0: _LIT8(KCipherTypeStart, ""); sl@0: _LIT8(KCipherTypeEnd, ""); sl@0: _LIT8(KIVStart, ""); sl@0: _LIT8(KIVEnd, ""); sl@0: _LIT8(KMonteCarloStart, ""); sl@0: _LIT8(KMonteCarloEnd, ""); sl@0: _LIT8(KEffKeyLenStart, ""); sl@0: _LIT8(KEffKeyLenEnd, ""); sl@0: _LIT8(KIterationsStart, ""); sl@0: _LIT8(KIterationsEnd, ""); sl@0: _LIT8(KRandDataSizeStart, ""); //Used specifically in performance tests where random data is used rather than specific input and output data pairs sl@0: _LIT8(KRandDataSizeEnd, ""); //Used specifically in performance tests where random data is used rather than specific input and output data pairs sl@0: sl@0: sl@0: class CCryptoTestAction : public CTestAction sl@0: { sl@0: public: sl@0: CCryptoTestAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut); sl@0: ~CCryptoTestAction(); sl@0: public: sl@0: virtual void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void DoReportAction(void); sl@0: virtual void DoCheckResult(TInt); sl@0: virtual void Reset(){} sl@0: protected: sl@0: virtual void DoPerformPrerequisiteL() = 0; sl@0: virtual void DoPerformActionL() = 0; sl@0: virtual void DoPerformPostrequisiteL() {} sl@0: protected: sl@0: void Hex(HBufC8& string); sl@0: void DoInputParseL(TDesC8& aScriptBuffer); sl@0: protected: sl@0: enum TCipherType sl@0: { sl@0: EDESECB, sl@0: EDESCBC, sl@0: E3DESECB, sl@0: E3DESCBC, sl@0: EAESECB, sl@0: EAESCBC, sl@0: EAESMonteCarloEncryptECB, // These extra categories have been added sl@0: EAESMonteCarloDecryptECB, // because the Monte-Carlo tests have to be sl@0: EAESMonteCarloEncryptCBC, // split between encrypt and decrypt scripts sl@0: EAESMonteCarloDecryptCBC, // (too big for test framework in one chunk) sl@0: ERC2ECB, sl@0: ERC2CBC, sl@0: ERC4, sl@0: ECipherNull sl@0: }; sl@0: protected: sl@0: RFs& iFs; sl@0: HBufC8* iBody; sl@0: HBufC8* iKey; sl@0: HBufC8* iInput; sl@0: HBufC8* iOutput; sl@0: HBufC8* iIV; sl@0: HBufC8* iEResult; sl@0: HBufC8* iDResult; sl@0: TInt iEffectiveKeyLen; sl@0: TInt iIterationTime; sl@0: TInt iEncryptIterations; sl@0: TInt iDecryptIterations; sl@0: TCipherType iCipherType; sl@0: TTimeIntervalMicroSeconds iEncryptorCreateTime; sl@0: TTimeIntervalMicroSeconds iDecryptorCreateTime; sl@0: TInt iExpectedWeakResult; sl@0: TInt iRandDataSize; sl@0: }; sl@0: sl@0: #endif // __CRYPTOTESTACTION_H__