crypto/weakcryptospi/test/tplugins/inc/tplugin02/pluginconfig.h
changeset 8 35751d3474b7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 2006-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 /**
       
    20  @file
       
    21  @@internalComponent
       
    22  @released
       
    23 */
       
    24 
       
    25 #ifndef __CRYPTOAPI_SOFTWAREPLUGINCONFIG_H__
       
    26 #define __CRYPTOAPI_SOFTWAREPLUGINCONFIG_H__
       
    27 
       
    28 #include <cryptospi/cryptoparams.h>
       
    29 #include <e32cmn.h>
       
    30 #include <cryptospi/romlit.h>
       
    31 #include "cryptospi/cryptospidef.h"
       
    32 #include "pluginconfigcommon.h"
       
    33 
       
    34 namespace SoftwareCrypto
       
    35 	{
       
    36 	using namespace CryptoSpi;
       
    37 	using namespace PluginCommon;
       
    38 
       
    39 	/**
       
    40 	Creator Name
       
    41 	*/
       
    42 	_ROMLIT16(KTestFramework, "TestFramework");
       
    43 	
       
    44 	/**
       
    45 	Implemetation Name
       
    46 	*/
       
    47 	_ROMLIT16(KMd2Description, "Md2");
       
    48 	_ROMLIT16(KMd5Description, "Md5");
       
    49 	_ROMLIT16(KSha1Description, "Sha1");
       
    50 	_ROMLIT16(KHmacMd2Description, "HmacMd2");
       
    51 	_ROMLIT16(KHmacMd5Description, "HmacMd5");
       
    52 	_ROMLIT16(KHmacSha1Description, "HmacSha1");
       
    53 	_ROMLIT16(KRandomDescription, "Random");
       
    54 	_ROMLIT16(KDesDescription, "Des");
       
    55 	_ROMLIT16(K3DesDescription, "3Des");
       
    56 	_ROMLIT16(KAesDescription, "Aes");
       
    57 	_ROMLIT16(KRC2Description, "RC2");
       
    58 	_ROMLIT16(KARC4Description, "ARC4");
       
    59 	_ROMLIT16(KRsaCipherDescription, "Rsa");
       
    60 	_ROMLIT16(KRsaSignerDescription, "RsaSigner");
       
    61 	_ROMLIT16(KDsaSignerDescription, "DsaSigner");
       
    62 	_ROMLIT16(KRsaVerifierDescription, "RsaVerifier");
       
    63 	_ROMLIT16(KDsaVerifierDescription, "DsaVerifier");
       
    64 	_ROMLIT16(KDHDescription, "DH");
       
    65 	_ROMLIT16(KSymmetricKeyGeneratorDescription, "Symmetric Key Generator");
       
    66 	_ROMLIT16(KKeyPairDescription, "Key Pair Generator");
       
    67 
       
    68 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
       
    69 	_ROMLIT16(KAesXcbcMac96Description, "AesXcbcMac96");
       
    70 	_ROMLIT16(KAesXcbcPrf128Description, "AesXcbcPrf128");
       
    71 #endif
       
    72 
       
    73 	/**
       
    74 	Common Mode Arrays
       
    75 	*/
       
    76 	static const TInt32 KDesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
       
    77 	static const TInt32 KDesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC};
       
    78 	static const TInt32 KHashOperationModes[]={KHashMode, KHmacMode};
       
    79 	static const TInt32 KRSACipherPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Encryption};
       
    80 	static const TInt32 KRSASignerPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Signature};
       
    81 
       
    82 	/**
       
    83 	Test Plugin 02 - Random 1
       
    84 	*/
       
    85 	static const TInt32 KTestPlugin02Random_1 = 0x102831B0;
       
    86 	static const TUid KTestPlugin02Random_1Uid = {KTestPlugin02Random_1};
       
    87 	static const TRandomCharacteristics KRandom_1 = 
       
    88 		{
       
    89 		KRandomInterface, 
       
    90 		KAlgorithmRandom, 
       
    91 		KTestPlugin02Random_1, 
       
    92 		&KSymbianTestFramework, 
       
    93 		EFalse, 
       
    94 		EFalse, 
       
    95 		6, 
       
    96 		&KRandomDescription, 
       
    97 		100, 
       
    98 		90, 
       
    99 		3
       
   100 		};	
       
   101 
       
   102 	/**
       
   103 	Test Plugin 02 - Hash MD5 1
       
   104 	*/
       
   105 	static const TInt32 KTestPlugin02Md5_1 = 0x102831B1;
       
   106 	static const TUid KTestPlugin02Md5_1Uid = {KTestPlugin02Md5_1};
       
   107 	static const THashCharacteristics KMd5_1 = 
       
   108 		{
       
   109 		KHashInterface, 
       
   110 		KAlgorithmHashMd5, 
       
   111 		KTestPlugin02Md5_1, 
       
   112 		&KTestFramework, 
       
   113 		EFalse, 
       
   114 		EFalse, 
       
   115 		6, 
       
   116 		&KHmacMd5Description, 
       
   117 		100, 
       
   118 		1024, 
       
   119 		512, 
       
   120 		128,
       
   121 		KHashOperationModes, sizeof(KHashOperationModes)/sizeof(TInt32)
       
   122 		};
       
   123 
       
   124 	/**
       
   125 	Test Plugin 02 - Symmetric Cipher DES 1
       
   126 	*/
       
   127 	
       
   128 	static const TInt32 KTestPlugin02Des_1 = 0x102831B2;
       
   129 	static const TUid KTestPlugin02Des_1Uid = {KTestPlugin02Des_1};
       
   130 	static const TSymmetricCipherCharacteristics KDes_1 = 
       
   131 		{
       
   132 		KSymmetricCipherInterface, 
       
   133 		KAlgorithmCipherDes, 
       
   134 		KTestPlugin02Des_1, 
       
   135 		&KSymbianTestFramework, 
       
   136 		EFalse, 
       
   137 		EFalse, 
       
   138 		6, 
       
   139 		&KDesDescription, 
       
   140 		100, 
       
   141 		90, 
       
   142 		64, 
       
   143 		64, 
       
   144 		KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), 
       
   145 		KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32),
       
   146 		4
       
   147 		};	
       
   148 
       
   149 	/**
       
   150 	Test Plugin 02 - Symmetric Cipher DES 2
       
   151 	*/
       
   152 	static const TInt32 KTestPlugin02Des_2 = 0x102831B3;
       
   153 	static const TUid KTestPlugin02Des_2Uid = {KTestPlugin02Des_2};
       
   154 	static const TSymmetricCipherCharacteristics KDes_2 = 
       
   155 		{
       
   156 		KSymmetricCipherInterface, 
       
   157 		KAlgorithmCipherDes, 
       
   158 		KTestPlugin02Des_2, 
       
   159 		&KSymbianTestFramework, 
       
   160 		EFalse, 
       
   161 		EFalse, 
       
   162 		6, 
       
   163 		&KDesDescription, 
       
   164 		101, 
       
   165 		90, 
       
   166 		64, 
       
   167 		32, 
       
   168 		KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), 
       
   169 		KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32),
       
   170 		3
       
   171 		};	
       
   172 
       
   173 	/**
       
   174 	Test Plugin 02 - Asymmetric Cipher RSA 1
       
   175 	*/
       
   176 	static const TInt32 KTestPlugin02Rsa_1 = 0x102831B4;
       
   177 	static const TUid KTestPlugin02Rsa_1Uid = {KTestPlugin02Rsa_1};
       
   178 	static const TAsymmetricCipherCharacteristics KRSA_1 = 
       
   179 		{
       
   180 		KAsymmetricCipherInterface, 
       
   181 		KAlgorithmCipherRsa, 
       
   182 		KTestPlugin02Rsa_1, 
       
   183 		&KSymbianTestFramework, 
       
   184 		EFalse, 
       
   185 		EFalse, 
       
   186 		6, 
       
   187 		&KRsaCipherDescription, 
       
   188 		100, 
       
   189 		90, 
       
   190 		256,
       
   191 		KRSACipherPaddingModes, sizeof(KRSACipherPaddingModes)/sizeof(TInt32),
       
   192 		3
       
   193 		};	
       
   194 
       
   195 	/**
       
   196 	Test Plugin 02 - Asymmetric Cipher RSA 2
       
   197 	*/
       
   198 	static const TInt32 KTestPlugin02Rsa_2 = 0x102831B5;
       
   199 	static const TUid KTestPlugin02Rsa_2Uid = {KTestPlugin02Rsa_2};
       
   200 	static const TAsymmetricCipherCharacteristics KRSA_2 = 
       
   201 		{
       
   202 		KAsymmetricCipherInterface, 
       
   203 		KAlgorithmCipherRsa, 
       
   204 		KTestPlugin02Rsa_2, 
       
   205 		&KSymbianTestFramework, 
       
   206 		EFalse, 
       
   207 		EFalse, 
       
   208 		6, 
       
   209 		&KRsaCipherDescription, 
       
   210 		100, 
       
   211 		90, 
       
   212 		512,
       
   213 		KRSACipherPaddingModes, sizeof(KRSACipherPaddingModes)/sizeof(TInt32),
       
   214 		2
       
   215 		};
       
   216 		
       
   217 	/**
       
   218 	Test Plugin 02 - RSA Key Generator 1
       
   219 	*/
       
   220 	static const TInt32 KTestPlugin02RsaKeyGen_1 = 0x102831B6;
       
   221 	static const TUid KTestPlugin02RsaKeyGen_1Uid={KTestPlugin02RsaKeyGen_1};
       
   222 	static const TAsymmetricKeypairGeneratorCharacteristics KRSAKeyPairGenerator_1 = 
       
   223 		{
       
   224 		KKeypairGeneratorInterface, 
       
   225 		KAlgorithmRSAKeyPairGenerator, 
       
   226 		KTestPlugin02RsaKeyGen_1, 
       
   227 		&KSymbianTestFramework, 
       
   228 		EFalse, 
       
   229 		EFalse, 
       
   230 		6, 
       
   231 		&KKeyPairDescription, 
       
   232 		100, 
       
   233 		90, 
       
   234 		1024
       
   235 		};
       
   236 		
       
   237 	/**
       
   238 	Test Plugin 02 - DH Key Pair Generator
       
   239 	*/
       
   240 	static const TInt32 KTestPlugin02DHKeyGen_1 = 0x102831B7;
       
   241 	static const TUid KTestPlugin02DHKeyGen_1Uid={KTestPlugin02DHKeyGen_1};
       
   242 	static const TAsymmetricKeypairGeneratorCharacteristics KDHKeyPairGenerator_1 = 
       
   243 		{
       
   244 		KKeypairGeneratorInterface, 
       
   245 		KAlgorithmDHKeyPairGenerator, 
       
   246 		KTestPlugin02DHKeyGen_1, 
       
   247 		&KSymbianTestFramework, 
       
   248 		EFalse, 
       
   249 		EFalse, 
       
   250 		6, 
       
   251 		&KKeyPairDescription, 
       
   252 		100, 
       
   253 		90, 
       
   254 		1024
       
   255 		};
       
   256 		
       
   257 	/**
       
   258 	Test Plugin 02 - RSA Signer 1
       
   259 	*/
       
   260 	static const TInt32 KTestPlugin02RsaSigner_1 = 0x102831B8;
       
   261 	static const TUid KTestPlugin02RsaSigner_1Uid={KTestPlugin02RsaSigner_1};
       
   262 	static const TAsymmetricSignatureCharacteristics KRSASigner_1 = 
       
   263 		{
       
   264 		KSignerInterface, 
       
   265 		KAlgorithmSignerRsa, 
       
   266 		KTestPlugin02RsaSigner_1, 
       
   267 		&KSymbianTestFramework, 
       
   268 		EFalse, 
       
   269 		EFalse, 
       
   270 		6, 
       
   271 		&KRsaSignerDescription, 
       
   272 		100, 
       
   273 		90, 
       
   274 		256, 
       
   275 		KRSASignerPaddingModes, sizeof(KRSASignerPaddingModes)/sizeof(TInt32),
       
   276 		3
       
   277 		};
       
   278 	
       
   279 	/**
       
   280 	Test Plugin 02 - DH Key Agreement 1
       
   281 	*/
       
   282 	static const TInt32 KTestPlugin02DHKeyAgree_1 = 0x102831B9;	
       
   283 	static const TUid KTestPlugin02DHKeyAgree_1Uid={KTestPlugin02DHKeyAgree_1};
       
   284 	static const TKeyAgreementCharacteristics KDH_1 = 
       
   285 		{
       
   286 		KKeyAgreementInterface, 
       
   287 		KAlgorithmKeyAgreementDH, 
       
   288 		KTestPlugin02DHKeyAgree_1, 
       
   289 		&KSymbianTestFramework, 
       
   290 		EFalse, 
       
   291 		EFalse, 
       
   292 		6, 
       
   293 		&KDHDescription, 
       
   294 		100, 
       
   295 		90
       
   296 		};
       
   297 		
       
   298 	/**
       
   299 	Test Plugin 02 - Random 2
       
   300 	*/
       
   301 	static const TInt32 KTestPlugin02Random_2 = 0x102831BA;
       
   302 	static const TUid KTestPlugin02Random_2Uid = {KTestPlugin02Random_2};
       
   303 	static const TRandomCharacteristics KRandom_2 = 
       
   304 		{
       
   305 		KRandomInterface, 
       
   306 		KAlgorithmRandom, 
       
   307 		KTestPlugin02Random_2, 
       
   308 		&KSymbianTestFramework, 
       
   309 		EFalse, 
       
   310 		EFalse, 
       
   311 		6, 
       
   312 		&KRandomDescription, 
       
   313 		100, 
       
   314 		90, 
       
   315 		2
       
   316 		};
       
   317  
       
   318 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
       
   319 	/**
       
   320 	Test Plugin 02 - AES
       
   321 	*/
       
   322 	static const TInt32 KTestPlugin02Aes = 0x102831BB;
       
   323 	static const TUid KTestPlugin02AesUid={KTestPlugin02Aes};
       
   324 	static const TInt32 KTestPlugin02AesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7};
       
   325 	static const TInt32 KTestPlugin02AesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC, KOperationModeCTR};
       
   326 	
       
   327 	static const TSymmetricCipherCharacteristics KAes_1 = 
       
   328 		{
       
   329 		KSymmetricCipherInterface,
       
   330 		KAlgorithmCipherAes,
       
   331 		KTestPlugin02Aes,
       
   332 		&KSymbianTestFramework,
       
   333 		EFalse,
       
   334 		EFalse,
       
   335 		6,
       
   336 		&KAesDescription,
       
   337 		100,
       
   338 		90, 
       
   339 		256 /* max key bits */,
       
   340 		128 /* block bits */,
       
   341 		KTestPlugin02AesPaddingModes,
       
   342 		sizeof(KTestPlugin02AesPaddingModes)/sizeof(KTestPlugin02AesPaddingModes[0]),
       
   343 		KTestPlugin02AesCryptoModes, sizeof(KTestPlugin02AesCryptoModes)/sizeof(KTestPlugin02AesCryptoModes[0]),
       
   344 		3
       
   345 		};
       
   346 
       
   347 
       
   348 	/**
       
   349 	Test Plugin 02 - AesXcbcMac96
       
   350 	*/
       
   351 	static const TInt32 KTestPlugin02XcbcMac96 = 0x102831BC;
       
   352 	static const TUid KTestPlugin02XcbcMac96Uid = {KTestPlugin02XcbcMac96};	
       
   353 	static const TMacCharacteristics KXcbcMac96Char = 
       
   354 		{
       
   355 		KMacInterface, 
       
   356 		KAlgorithmCipherAesXcbcMac96, 
       
   357 		KTestPlugin02XcbcMac96, 
       
   358 		&KSymbianTestFramework, 
       
   359 		EFalse, 
       
   360 		EFalse, 
       
   361 		6, 
       
   362 		&KAesXcbcMac96Description, 
       
   363 		20, 
       
   364 		200, 
       
   365 		KSymmetricCipherMode, 
       
   366 		0,
       
   367 		&KAes_1
       
   368 		};
       
   369 
       
   370 	/**
       
   371 	Test Plugin 02 - AesXcbcPrf128
       
   372 	*/
       
   373 	static const TInt32 KTestPlugin02XcbcPrf128 = 0x102831BD;
       
   374 	static const TUid KTestPlugin02XcbcMacPrf128Uid = {KTestPlugin02XcbcPrf128};	
       
   375 	static const TMacCharacteristics KXcbcPrf128Char = 
       
   376 		{
       
   377 		KMacInterface, 
       
   378 		KAlgorithmCipherAesXcbcPrf128, 
       
   379 		KTestPlugin02XcbcPrf128, 
       
   380 		&KSymbianTestFramework, 
       
   381 		EFalse, 
       
   382 		EFalse, 
       
   383 		5, 
       
   384 		&KAesXcbcPrf128Description, 
       
   385 		20, 
       
   386 		90, 
       
   387 		KSymmetricCipherMode, 
       
   388 		0,
       
   389 		&KAes_1
       
   390 		};
       
   391 #endif
       
   392 
       
   393 	/**
       
   394 	Random implemetation characteristic table
       
   395 	*/
       
   396 	static const TRandomCharacteristics* const KRandomCharacteristics[]=
       
   397 		{
       
   398 		&KRandom_1, &KRandom_2	
       
   399 		};	
       
   400 
       
   401 	/**
       
   402 	Hash implemetation characteristic table
       
   403 	*/
       
   404 	static const THashCharacteristics* const KHashCharacteristics[]=
       
   405 		{
       
   406 		&KMd5_1	
       
   407 		};
       
   408 
       
   409 	/**
       
   410 	Symmetric Cipher implemetation characteristic table
       
   411 	*/
       
   412 	static const TSymmetricCipherCharacteristics* const KSymmetricCipherCharacteristics[]=
       
   413 		{
       
   414 		&KDes_1, &KDes_2
       
   415 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
       
   416 , &KAes_1
       
   417 #endif
       
   418 		};	
       
   419 	
       
   420 	/**
       
   421 	Asymmetric Cipher implemetation characteristic table
       
   422 	*/
       
   423 	static const TAsymmetricCipherCharacteristics* const KAsymmetricCipherCharacteristics[]=
       
   424 		{
       
   425 		&KRSA_1, &KRSA_2	
       
   426 		};
       
   427 		
       
   428 	/**
       
   429 	Key pair generator implementation characteristic table
       
   430 	*/
       
   431 	static const TAsymmetricKeypairGeneratorCharacteristics* const KKeyPairGeneratorCharacteristics[]=
       
   432 		{
       
   433 		&KRSAKeyPairGenerator_1, &KDHKeyPairGenerator_1
       
   434 		};
       
   435 		
       
   436 	/**
       
   437 	Signer implementation characteristic table
       
   438 	*/
       
   439 	static const TAsymmetricSignatureCharacteristics* const KSignerCharacteristics[]=
       
   440 		{
       
   441 		&KRSASigner_1
       
   442 		};
       
   443 			
       
   444 	/**
       
   445 	Key Agreement implementation characteristic table
       
   446 	*/
       
   447 	static const TKeyAgreementCharacteristics* const KKeyAgreementCharacteristics[]=
       
   448 		{
       
   449 		&KDH_1
       
   450 		};
       
   451 	
       
   452 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
       
   453 	static const TMacCharacteristics* const KMacCharacteristics[]=
       
   454 		{
       
   455 		&KXcbcMac96Char, &KXcbcPrf128Char	
       
   456 		};	
       
   457 #endif
       
   458 	}
       
   459 
       
   460 #endif //__CRYPTOAPI_SOFTWAREPLUGINCONFIG_H__