crypto/weakcryptospi/test/tasymmetric/tasymmetricmain.cpp
changeset 8 35751d3474b7
child 102 deec7e509f66
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "t_testhandler.h"
       
    21 #include "tscripttests.h"
       
    22 #include "trsaencryptfb.h"
       
    23 #include "trsasignfb.h"
       
    24 #include "tdsasignfb.h"
       
    25 #include "trsavector.h"
       
    26 #include "tdsavector.h"
       
    27 #include "tdsasignfb.h"
       
    28 #include "tdsaprimegen.h"
       
    29 #include "performancetest.h"
       
    30 #include "tdhvector.h"
       
    31 #include "trsaparams.h"
       
    32 #include "tasymmetricmisc.h"
       
    33 
       
    34 LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
       
    35     {
       
    36 	START_SCRIPT_LIST
       
    37 	SCRIPT_ITEM(CRSAEncryptFB,_L8("RSAEncryptStandardAndCRTFB")),
       
    38 	SCRIPT_ITEM(CRSASignFB,_L8("RSASignStandardAndCRTFB")),
       
    39 	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
       
    40 	SCRIPT_ITEM(CRSAEncryptVector,_L8("RSAEncryptVector")),
       
    41 	SCRIPT_ITEM(CRSADecryptVector,_L8("RSADecryptVector")),
       
    42 	SCRIPT_ITEM(CRSADecryptVectorCRT,_L8("RSADecryptVectorCRT")),
       
    43 	SCRIPT_ITEM(CRSASignVector,_L8("RSASignVector")),
       
    44 	SCRIPT_ITEM(CRSASignVectorCRT,_L8("RSASignVectorCRT")),
       
    45 	SCRIPT_ITEM(CRSAVerifyVector,_L8("RSAVerifyVector")),
       
    46 	SCRIPT_ITEM(CDSASignVector,_L8("DSASignVector")),
       
    47 	SCRIPT_ITEM(CDSAVerifyVector,_L8("DSAVerifyVector")),
       
    48 	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
       
    49 	SCRIPT_ITEM(CDSAPrimeGen,_L8("DSAPrimeGen")),
       
    50 	SCRIPT_ITEM(CPerformanceTest, _L8("PerformanceTestSettings")),
       
    51 	SCRIPT_ITEM(CDHVector,_L8("DHVector")),
       
    52 	SCRIPT_ITEM(CRSATestPublicKey,_L8("RSAPublicKeyParams")),
       
    53 	SCRIPT_ITEM(CRSATestPrivateKey,_L8("RSAPrivateKeyParams")),
       
    54 	SCRIPT_ITEM(CRSATestPrivateKeyCRT,_L8("RSAPrivateKeyCRTParams")),
       
    55 	SCRIPT_ITEM(CAsymmetricMiscellaneous,_L8("AsymmetricMiscellaneous"))
       
    56 	END_SCRIPT_LIST
       
    57 
       
    58 //	Either run the top level build and test script or, if running this test specifically, 
       
    59 //	uncomment the following and it'll run them all one after the other
       
    60 
       
    61 	//get the system drive.	
       
    62 	TDriveUnit sysDrive (RFs::GetSystemDrive());
       
    63 	TBuf<64> scriptFile = sysDrive.Name();
       
    64 	scriptFile.Append(_L("\\tasymmetric\\tasymmetrictests.txt"));
       
    65 	TBuf<64> logFile = sysDrive.Name();
       
    66 	logFile.Append(_L("\\tasymmetric\\tasymmetrictests.log"));
       
    67 	CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
       
    68 	
       
    69 /* If you want to run all of the asymmetric tests from the command
       
    70  * line, uncomment this next section.
       
    71 #ifndef _DEBUG
       
    72 	CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tasymmetric\\asymmetricPerformance.txt"),
       
    73 		_L("c:\\tasymmetric\\asymmetricPerformance.log"));	
       
    74 #endif
       
    75 */
       
    76     }
       
    77 
       
    78 GLDEF_C TInt E32Main() // main function called by E32
       
    79     {
       
    80 	__UHEAP_MARK;
       
    81 	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
       
    82 	CPerformance::NewL();
       
    83 	TRAPD(error, callExampleL());
       
    84 	CPerformance::ClosePerformanceTester();
       
    85 	__ASSERT_ALWAYS(!error,User::Panic(_L("tasymmetricmain"),error));
       
    86 	delete cleanup; // destroy clean-up stack
       
    87 	__UHEAP_MARKEND;
       
    88 	return 0;
       
    89     }