os/security/crypto/weakcrypto/test/tasymmetric/tasymmetricmain.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 
    33 LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
    34     {
    35 	START_SCRIPT_LIST
    36 	SCRIPT_ITEM(CRSAEncryptFB,_L8("RSAEncryptStandardAndCRTFB")),
    37 	SCRIPT_ITEM(CRSASignFB,_L8("RSASignStandardAndCRTFB")),
    38 	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
    39 	SCRIPT_ITEM(CRSAEncryptVector,_L8("RSAEncryptVector")),
    40 	SCRIPT_ITEM(CRSADecryptVector,_L8("RSADecryptVector")),
    41 	SCRIPT_ITEM(CRSADecryptVectorCRT,_L8("RSADecryptVectorCRT")),
    42 	SCRIPT_ITEM(CRSASignVector,_L8("RSASignVector")),
    43 	SCRIPT_ITEM(CRSASignVectorCRT,_L8("RSASignVectorCRT")),
    44 	SCRIPT_ITEM(CRSAVerifyVector,_L8("RSAVerifyVector")),
    45 	SCRIPT_ITEM(CDSASignVector,_L8("DSASignVector")),
    46 	SCRIPT_ITEM(CDSAVerifyVector,_L8("DSAVerifyVector")),
    47 	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
    48 	SCRIPT_ITEM(CDSAPrimeGen,_L8("DSAPrimeGen")),
    49 	SCRIPT_ITEM(CPerformanceTest, _L8("PerformanceTestSettings")),
    50 	SCRIPT_ITEM(CDHVector,_L8("DHVector")),
    51 	SCRIPT_ITEM(CRSATestPublicKey,_L8("RSAPublicKeyParams")),
    52 	SCRIPT_ITEM(CRSATestPrivateKey,_L8("RSAPrivateKeyParams")),
    53 	SCRIPT_ITEM(CRSATestPrivateKeyCRT,_L8("RSAPrivateKeyCRTParams"))
    54 	END_SCRIPT_LIST
    55 
    56 //	Either run the top level build and test script or, if running this test specifically, 
    57 //	uncomment the following and it'll run them all one after the other
    58 
    59 	//get the system drive.	
    60 	TDriveUnit sysDrive (RFs::GetSystemDrive());
    61 	TBuf<64> scriptFile = sysDrive.Name();
    62 	scriptFile.Append(_L("\\tasymmetric\\tasymmetrictests.txt"));
    63 	TBuf<64> logFile = sysDrive.Name();
    64 	logFile.Append(_L("\\tasymmetric\\tasymmetrictests.log"));
    65 	CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
    66 	
    67 /* The test framework can't handle more than one script
    68  * at a time.  If you want to run all of the asymmetric tests from the command
    69  * line, uncomment this next section.
    70 #ifndef _DEBUG
    71 	CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tasymmetric\\asymmetricPerformance.txt"),
    72 		_L("c:\\tasymmetric\\asymmetricPerformance.log"));	
    73 #endif
    74 */
    75     }
    76 
    77 GLDEF_C TInt E32Main() // main function called by E32
    78     {
    79 	__UHEAP_MARK;
    80 	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
    81 	CPerformance::NewL();
    82 	TRAPD(error, callExampleL());
    83 	CPerformance::ClosePerformanceTester();
    84 	__ASSERT_ALWAYS(!error,User::Panic(_L("tasymmetricmain"),error));
    85 	delete cleanup; // destroy clean-up stack
    86 	__UHEAP_MARKEND;
    87 	return 0;
    88     }