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: #include sl@0: #include "t_testhandler.h" sl@0: #include "t_testsetup.h" sl@0: #include "tscripttests.h" sl@0: #include "tactionvector.h" sl@0: #include "tperformancetest.h" sl@0: #include "tactionincremental.h" sl@0: #include "tactionmontecarlo.h" sl@0: sl@0: LOCAL_D void callExampleL() // initialize and call example code under cleanup stack sl@0: { sl@0: START_SCRIPT_LIST sl@0: SCRIPT_ITEM(CActionVector,_L8("Vector")), sl@0: SCRIPT_ITEM(CPerformanceTest,_L8("Performance")), sl@0: SCRIPT_ITEM(CActionIncremental,_L8("Incremental")), sl@0: SCRIPT_ITEM(CActionMonteCarlo, _L8("MonteCarlo")) sl@0: END_SCRIPT_LIST sl@0: sl@0: TDriveUnit sysDrive (RFs::GetSystemDrive()); sl@0: TDriveName sysDriveName (sysDrive.Name()); sl@0: TBuf<64> scriptFile (sysDriveName); sl@0: scriptFile.Append(_L("\\tsymmetric\\tsymmetrictests.txt")); sl@0: sl@0: TBuf<64> logFile (sysDriveName); sl@0: logFile.Append(_L("\\tsymmetric\\tsymmetrictests.log")); sl@0: sl@0: sl@0: // RC2, RC4, DES, 3DES (ECB and CBC modes) sl@0: /* CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\symmetricOOMtests.txt"), sl@0: _L("c:\\tsymmetric\\symmetricOOMtests.log"));*/ sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile); sl@0: sl@0: // CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\tsymmetricperformancetests.txt"), sl@0: // _L("c:\\tsymmetric\\tsymmetricperformancetests.log")); sl@0: sl@0: // There are so many other test scripts because it is impossible to put all the test sl@0: // data in one big script. The test framework just falls over with out of memory because sl@0: // it attempts to create all test objects at the start of the test. All these tests sl@0: // are (of course) necessary hence they've been split. Either run the top level build sl@0: // and test script or, if running this test specifically, uncomment the following and it'll run them sl@0: // all one after the other sl@0: // AES (ECB) using Rijndael vectors for all table values sl@0: /* CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESECBVectorsScript.txt"), sl@0: _L("c:\\tsymmetric\\aesecb_vectors.log")); sl@0: sl@0: // AES (ECB) KAT using variable text, known key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESECB_KAT_VT.txt"), sl@0: _L("c:\\tsymmetric\\aesecb_kat_vt.log")); sl@0: sl@0: // AES (ECB) KAT using variable key, known text sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESECB_KAT_VK.txt"), sl@0: _L("c:\\tsymmetric\\aesecb_kat_vk.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB encrypt) with 128 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptECB128.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptECB128.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB encrypt) with 192 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptECB192.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptECB192.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB encrypt) with 256 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptECB256.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptECB256.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB decrypt) with 128 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptECB128.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptECB128.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB decrypt) with 192 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptECB192.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptECB192.log")); sl@0: sl@0: // AES Monte Carlo tests (ECB decrypt) with 256 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptECB256.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptECB256.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC encrypt) with 128 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptCBC128.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptCBC128.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC encrypt) with 192 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptCBC192.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptCBC192.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC encrypt) with 256 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloEncryptCBC256.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_encryptCBC256.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC decrypt) with 128 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptCBC128.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptCBC128.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC decrypt) with 192 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptCBC192.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptCBC192.log")); sl@0: sl@0: // AES Monte Carlo tests (CBC decrypt) with 256 bit key sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\AESMonteCarloDecryptCBC256.txt"), sl@0: _L("c:\\tsymmetric\\aesmontecarlo_decryptCBC256.log")); sl@0: sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tsymmetric\\symmetricOOMtests.txt"), sl@0: _L("c:\\tsymmetric\\symmetricOOMtests.log")); sl@0: */} sl@0: sl@0: GLDEF_C TInt E32Main() // main function called by E32 sl@0: { sl@0: __UHEAP_MARK; sl@0: CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack sl@0: TRAPD(error, callExampleL()); sl@0: __ASSERT_ALWAYS(!error,User::Panic(_L("tsymmetric"),error)); sl@0: delete cleanup; // destroy clean-up stack sl@0: __UHEAP_MARKEND; sl@0: return 0; sl@0: }