os/security/crypto/weakcryptospi/test/tcryptospi/src/te_cryptospidefs.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcryptospi/test/tcryptospi/src/te_cryptospidefs.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,293 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* This file define all the common values thoughout your test project
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +/**
    1.26 + @file
    1.27 + @internalTechnology
    1.28 +*/
    1.29 +#if (!defined __TE_CRYPTOSPI_SUITEDEFS_H__)
    1.30 +#define __TE_CRYPTOSPI_SUITEDEFS_H__
    1.31 +
    1.32 +#include <cryptospi/romlit.h>
    1.33 +#include <cryptospi/cryptospidef.h>
    1.34 +
    1.35 +namespace CryptoSpi
    1.36 +	{
    1.37 +
    1.38 +	const TInt KKeyExponent = 65537;
    1.39 +
    1.40 +	//tplugin01 implementation definitions
    1.41 +	const TInt32 KTestPlugin01Des_1 = 0x102831A1;
    1.42 +	const TInt32 KTestPlugin01Des_2 = 0x102831A2;
    1.43 +	const TInt32 KTestPlugin01Des_3 = 0x102831A3;
    1.44 +	const TInt32 KTestPlugin01Des_4 = 0x102831A4;
    1.45 +	const TInt32 KTestPlugin01Md2_1 = 0x102831A5;
    1.46 +	const TInt32 KTestPlugin01Md2_2 = 0x102831A6;
    1.47 +	const TInt32 KTestPlugin01RsaKeyGen_1 = 0x102831A7;
    1.48 +	const TInt32 KTestPlugin01RsaVerifier_1 = 0x102831A8;
    1.49 +	const TInt32 KTestPlugin01RsaVerifier_2 = 0x102831A9;
    1.50 +	
    1.51 +	//tplugin02 implementation definitions
    1.52 +	const TInt32 KTestPlugin02Random_1 = 0x102831B0;
    1.53 +	const TInt32 KTestPlugin02Md5_1 = 0x102831B1;
    1.54 +	const TInt32 KTestPlugin02Des_1 = 0x102831B2;
    1.55 +	const TInt32 KTestPlugin02Des_2 = 0x102831B3;
    1.56 +	const TInt32 KTestPlugin02Rsa_1 = 0x102831B4;
    1.57 +	const TInt32 KTestPlugin02Rsa_2 = 0x102831B5;
    1.58 +	const TInt32 KTestPlugin02RsaKeyGen_1 = 0x102831B6;
    1.59 +	const TInt32 KTestPlugin02DHKeyGen_1 = 0x102831B7;
    1.60 +	const TInt32 KTestPlugin02RsaSigner_1 = 0x102831B8;
    1.61 +	const TInt32 KTestPlugin02DHKeyAgree_1 = 0x102831B9;
    1.62 +	const TInt32 KTestPlugin02Random_2 = 0x102831BA;
    1.63 +	
    1.64 +	//softwarecrypto implementation definitions
    1.65 +	const TInt32 KCryptoPluginMd2 = 0x102831D0;
    1.66 +	const TInt32 KCryptoPluginMd5 = 0x102831D1;
    1.67 +	const TInt32 KCryptoPluginSha1 = 0x102831D2;
    1.68 +	const TInt32 KCryptoPluginSha224 = 0x2000E25C;
    1.69 +	const TInt32 KCryptoPluginSha256 = 0x2000E25D;
    1.70 +	const TInt32 KCryptoPluginSha384 = 0x2000E25E;
    1.71 +	const TInt32 KCryptoPluginSha512 = 0x2000E25F;
    1.72 +	const TInt32 KCryptoPluginRandom = 0x102831D3;
    1.73 +	const TInt32 KCryptoPluginDes = 0x102831D4;
    1.74 +	const TInt32 KCryptoPlugin3Des = 0x102831D5;
    1.75 +	const TInt32 KCryptoPluginAes = 0x102831D6;
    1.76 +	const TInt32 KCryptoPluginRc2 = 0x102831D7;
    1.77 +	const TInt32 KCryptoPluginArc4 = 0x102831D8;
    1.78 +	const TInt32 KCryptoPluginRsaCipher = 0x102831D9;
    1.79 +	const TInt32 KCryptoPluginRsaSigner = 0x102831DA;
    1.80 +	const TInt32 KCryptoPluginDsaSigner = 0x102831DB;
    1.81 +	const TInt32 KCryptoPluginRsaVerifier = 0x102831DC;
    1.82 +	const TInt32 KCryptoPluginDsaVerifier = 0x102831DD;
    1.83 +	const TInt32 KCryptoPluginDhKeyAgreement = 0x102831DE;
    1.84 +	const TInt32 KCryptoPluginDhKeyPairGen = 0x102831DF;
    1.85 +	const TInt32 KCryptoPluginRsaKeyPairGen = 0x102831E0;
    1.86 +	const TInt32 KCryptoPluginDsaKeyPairGen = 0x102831E1;
    1.87 +#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
    1.88 +	const TInt32 KTestPlugin01Aes = 0x102831AA;
    1.89 +	const TInt32 KTestPlugin01XcbcMac96 = 0x102831AB;
    1.90 +	const TInt32 KTestPlugin01MacMd2_1 = 0x102831AC;
    1.91 +	const TInt32 KTestPlugin01MacMd2_2 = 0x102831AD;
    1.92 +	const TInt32 KTestPlugin02Aes = 0x102831BB;
    1.93 +	const TInt32 KTestPlugin02XcbcMac96 = 0x102831BC;
    1.94 +	const TInt32 KTestPlugin02XcbcPrf128 = 0x102831BD;
    1.95 +#endif
    1.96 +
    1.97 +	//creator name definitions
    1.98 +	_ROMLIT16(KSymbian, "Symbian");
    1.99 +	_ROMLIT16(KSymbianTestFramework, "SymbianTestFramework");
   1.100 +	_ROMLIT16(KTestFramework, "TestFramework");
   1.101 +	_ROMLIT16(KAlternativeName, "AlternativeName");
   1.102 +
   1.103 +	//implementation name definitions
   1.104 +	_ROMLIT16(KMd2Description, "Md2");
   1.105 +	_ROMLIT16(KMd5Description, "Md5");
   1.106 +	_ROMLIT16(KSha1Description, "Sha1");
   1.107 +	_ROMLIT16(KSha224Description, "Sha224");
   1.108 +	_ROMLIT16(KSha256Description, "Sha256");
   1.109 +	_ROMLIT16(KSha384Description, "Sha384");
   1.110 +	_ROMLIT16(KSha512Description, "Sha512");
   1.111 +	_ROMLIT16(KHmacMd2Description, "HmacMd2");
   1.112 +	_ROMLIT16(KHmacMd5Description, "HmacMd5");
   1.113 +	_ROMLIT16(KHmacSha1Description, "HmacSha1");
   1.114 +	_ROMLIT16(KHmacSha224Description, "HmacSha224");
   1.115 +	_ROMLIT16(KHmacSha256Description, "HmacSha256");
   1.116 +	_ROMLIT16(KHmacSha384Description, "HmacSha384");
   1.117 +	_ROMLIT16(KHmacSha512Description, "HmacSha512");
   1.118 +	_ROMLIT16(KRandomDescription, "Random");
   1.119 +	_ROMLIT16(KDesDescription, "Des");
   1.120 +	_ROMLIT16(K3DesDescription, "3Des");
   1.121 +	_ROMLIT16(KAesDescription, "Aes");
   1.122 +	_ROMLIT16(KRC2Description, "RC2");
   1.123 +	_ROMLIT16(KARC4Description, "ARC4");
   1.124 +	_ROMLIT16(KRsaCipherDescription, "Rsa");
   1.125 +	_ROMLIT16(KRsaSignerDescription, "RsaSigner");
   1.126 +	_ROMLIT16(KDsaSignerDescription, "DsaSigner");
   1.127 +	_ROMLIT16(KRsaVerifierDescription, "RsaVerifier");
   1.128 +	_ROMLIT16(KDsaVerifierDescription, "DsaVerifier");
   1.129 +	_ROMLIT16(KDHDescription, "DH");
   1.130 +	_ROMLIT16(KSymmetricKeyGeneratorDescription, "Symmetric Key Generator");
   1.131 +	_ROMLIT16(KKeyPairDescription, "Key Pair Generator");
   1.132 +#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
   1.133 +	_ROMLIT16(KAesXcbcMac96Description, "AesXcbcMac96");
   1.134 +	_ROMLIT16(KAesXcbcPrf128Description, "AesXcbcPrf128");
   1.135 +#endif
   1.136 +	
   1.137 +	//operation mode definitions
   1.138 +	const TInt32 KHashOperationModes[]={KHashMode, KHmacMode};
   1.139 +	const TInt32 KDesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC};
   1.140 +	const TInt32 K3DesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC};
   1.141 +	const TInt32 KAesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC};
   1.142 +	const TInt32 KRc2CryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC};
   1.143 +	const TInt32 KArc4CryptoModes[]={KOperationModeNone};
   1.144 +
   1.145 +	//padding mode definitions
   1.146 +	const TInt32 KDesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
   1.147 +	const TInt32 K3DesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
   1.148 +	const TInt32 KAesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
   1.149 +	const TInt32 KRc2PaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
   1.150 +	const TInt32 KArc4PaddingModes[]={KPaddingModeNone};
   1.151 +	const TInt32 KRSACipherPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Encryption};
   1.152 +	const TInt32 KRSASignerPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Signature};
   1.153 +	const TInt32 KDSASignerPaddingModes[]={KPaddingModeNone};
   1.154 +	const TInt32 KRSAVerifierPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Signature};
   1.155 +	const TInt32 KDSAVerifierPaddingModes[]={KPaddingModeNone};
   1.156 +	
   1.157 +	//Extended Characteristic Uids
   1.158 +	const TInt32 KExtendCharType1 = 0x102ABCD1;
   1.159 +	const TUid KExtendCharType1Uid ={KExtendCharType1};
   1.160 +
   1.161 +	const TInt32 KExtendCharType2 = 0x102ABCD2;
   1.162 +	const TUid KExtendCharType2Uid ={KExtendCharType2};
   1.163 +
   1.164 +	const TInt32 KExtendCharType3 = 0x102ABCD3;
   1.165 +	const TUid KExtendCharType3Uid ={KExtendCharType3};	
   1.166 +
   1.167 +	//***********************************************************************
   1.168 +	//INI Configuration Parameter Definitons
   1.169 +	//***********************************************************************
   1.170 +
   1.171 +	//Test Case Initialisation Parameters
   1.172 +	_LIT(KConfigInterfaceType,"InterfaceType");
   1.173 +	_LIT(KConfigEncryptKey,"EncryptKey");
   1.174 +	_LIT(KConfigInvalidKey, "InvalidKey");
   1.175 +	_LIT(KConfigEncryptKeyType,"KeyType");
   1.176 +	_LIT(KConfigTestCaseId,"TestCaseId");
   1.177 +	_LIT(KConfigAlgorithmUid,"AlgorithmUid");
   1.178 +	_LIT(KConfigCryptoMode,"CryptoMode");
   1.179 +	_LIT(KConfigOperationMode,"OperationMode");
   1.180 +	_LIT(KConfigPaddingMode,"PaddingMode");
   1.181 +	_LIT(KConfigAlgorithmParams,"AlgorithmParams");
   1.182 +	_LIT(KConfigSourcePath,"SourcePath");
   1.183 +	_LIT(KConfigEncryptedPath,"EncryptedPath");
   1.184 +	_LIT(KConfigIVPath,"IVPath");
   1.185 +	
   1.186 +	_LIT(KConfigInvalidPaddingMode,"InvalidPaddingMode");
   1.187 +	_LIT(KConfigInvalidOperationMode,"InvalidOperationMode");
   1.188 +
   1.189 +	//Source File Parameters
   1.190 +	const TInt KDataReadBlocks = 20;
   1.191 +
   1.192 +	//Symmetric/Asymmetric Parameters
   1.193 +	_LIT(KConfigExEncryptedData,"Encrypted");
   1.194 +
   1.195 +	//*****ASYMMETRIC ENCRYPT DATA CHECK PARAMS - TEMP*****
   1.196 +	_LIT(KConfigKeyModulous,"Modulous");
   1.197 +	_LIT(KConfigKeyExponent,"Exponent");
   1.198 +	//*****ASYMMETRIC ENCRYPT DATA CHECK PARAMS - TEMP*****
   1.199 +
   1.200 +	//Hash/Hmac Specific Parameters
   1.201 +	_LIT(KConfigExHashHmacValue,"ExHashValue");
   1.202 +	_LIT(KConfigExSecondHashHmacValue,"ExSecondHashValue");
   1.203 +	_LIT(KConfigSecondOperationMode,"SecondOperationMode");
   1.204 +	_LIT(KConfigThreadName,"WorkerThreadName");
   1.205 +
   1.206 +	//Key Exchange/Generation & Signer/Verifier Parameters
   1.207 +	_LIT(KConfigExchangeTestType,"TestType");
   1.208 +	_LIT(KConfigExchangeKey,"Key");
   1.209 +	_LIT(KConfigExchangePaddingMode,"PaddingMode");
   1.210 +	_LIT(KConfigExchangePaddingMode1,"PaddingMode1");
   1.211 +	_LIT(KConfigExchangePaddingMode2,"PaddingMode2");
   1.212 +	_LIT(KConfigExchangePaddingMode3,"PaddingMode3");
   1.213 +	_LIT(KConfigExchangeKeyTypeVariant, "Keytype");
   1.214 +	_LIT(KConfigSignVerifyType, "Type");
   1.215 +	_LIT(KConfigSignVerifyData, "Data");
   1.216 +	_LIT(KConfigSignVerifySigR, "SignatureR");
   1.217 +	_LIT(KConfigSignVerifySigS, "SignatureS");
   1.218 +
   1.219 +	//Common Definitions
   1.220 +	_LIT(KNullString, "NULL");
   1.221 +	_LIT(KEmptyString, "");
   1.222 +	_LIT8(KFileNewLine,"\r\n");
   1.223 +
   1.224 +	//Plugin Load
   1.225 +	_LIT(KConfigRuleSelectorToggle, "RuleSelectorToggle");
   1.226 +
   1.227 +	//********************CHARACTERISTICS**********************
   1.228 +
   1.229 +	//Selection Rule Input Parameters
   1.230 +	_LIT(KConfigInterfaceScopeBase,"InterfaceScopeRule");
   1.231 +	_LIT(KConfigAlgorithmScopeBase,"AlgorithmScopeRule");
   1.232 +	_LIT(KConfigCharUidBase, "CharacterUidRule");
   1.233 +	_LIT(KConfigCompareOperatorBase, "CompareOperatorRule");
   1.234 +	_LIT(KConfigCharValueBase, "CharacterValueRule");
   1.235 +	_LIT(KConfigCharValueTypeBase, "CharacterValueTypeRule");
   1.236 +	_LIT(KConfigIsOptionalBase, "IsOptionaRule");
   1.237 +
   1.238 +	const TInt KMaxConfigParamStringSize = 30;	//Max String Size for Dynamic INI file parameters
   1.239 +
   1.240 +	//Expected Common Characteristics
   1.241 +	_LIT(KConfigExInterfaceUid, "ExInterfaceUid");
   1.242 +	_LIT(KConfigExAlgorithmUid, "ExAlgorithmUid");
   1.243 +	_LIT(KConfigExImplementationUid, "ExImplementationUid");
   1.244 +	_LIT(KConfigExCreatorName, "ExCreatorName");
   1.245 +	_LIT(KConfigExFIPSApproved, "ExFIPSApproved");
   1.246 +	_LIT(KConfigExHardwareSupport, "ExHardwareSupport");
   1.247 +	_LIT(KConfigExMaxConcurrency, "ExMaxConcurrency");
   1.248 +	_LIT(KConfigExAlgorithmName, "ExAlgorithmName");
   1.249 +	_LIT(KConfigExLatency, "ExLatency");
   1.250 +	_LIT(KConfigExThroughput, "ExThroughput");
   1.251 +
   1.252 +	//Expected Cipher Characteristics
   1.253 +	_LIT(KConfigExMaxKeyLength, "ExMaxKeyLength");
   1.254 +	_LIT(KConfigExKeySupportMode, "ExKeySupportMode");
   1.255 +	_LIT(KConfigExPaddingModes, "ExPaddingModes");
   1.256 +	_LIT(KConfigExPaddingModeNum, "ExPaddingModeNum");
   1.257 +	_LIT(KConfigExBlockSize, "ExBlockSize");
   1.258 +	_LIT(KConfigExOperationModes, "ExOperationModes");  
   1.259 +	_LIT(KConfigExOperationModeNum, "ExOperationModeNum"); 
   1.260 +
   1.261 +	//Expected Hash/Hmac Specific Characteristics
   1.262 +	_LIT(KConfigExOutputSize, "ExOutputSize");
   1.263 +		
   1.264 +	//Expected Random Specific Characteristics
   1.265 +	_LIT(KConfigExBlockingMode, "ExBlockingMode"); 
   1.266 +
   1.267 +	//Expected Extended Characteristics
   1.268 +	_LIT(KConfigExExtendConcurrency, "ExExtendConcurrency");
   1.269 +	_LIT(KConfigExExtendExclusiveUse, "ExExtendExclusiveUse");
   1.270 +	_LIT(KConfigExExtendTestChar1, "ExExtendTestChar1");
   1.271 +	_LIT(KConfigExExtendTestChar2, "ExExtendTestChar2");
   1.272 +	_LIT(KConfigExExtendTestChar3, "ExExtendTestChar3");
   1.273 +
   1.274 +#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
   1.275 +	_LIT(KConfigEncryptKeyPath,"EncryptKeyPath");
   1.276 +
   1.277 +	//Mac Specific Parameters
   1.278 +	_LIT(KConfigExMacValue,"ExMacValue");
   1.279 +
   1.280 +	//Expected Mac Specific Characteristics
   1.281 +	_LIT(KConfigExMacMode, "ExMacMode");
   1.282 +#endif
   1.283 +	
   1.284 +	enum TReturnValueType
   1.285 +		{
   1.286 +		ERuleValueInteger,
   1.287 +		ERuleValueDes8,
   1.288 +		ERuleValueDes16,
   1.289 +		ERuleValueBoolean		
   1.290 +		};
   1.291 +			
   1.292 +	// For test step panics
   1.293 +	_LIT(KTe_CryptoSpiPanic,"Te_CryptoSpi");
   1.294 +	
   1.295 +	}
   1.296 +#endif