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