|
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(KAlternativeName, "AlternativeName"); |
|
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 #endif |
|
71 |
|
72 /** |
|
73 Common Mode Arrays |
|
74 */ |
|
75 static const TInt32 KDesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7}; |
|
76 static const TInt32 KRSAVerifierPaddingModes[]={KPaddingModeNone, KPaddingModePkcs1_v1_5_Signature}; |
|
77 static const TInt32 KDesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC}; |
|
78 static const TInt32 KHashOperationModes[]={KHashMode, KHmacMode}; |
|
79 |
|
80 |
|
81 /** |
|
82 Test Plugin 01 - Symmetric Cipher DES 1 |
|
83 */ |
|
84 static const TInt32 KTestPlugin01Des_1 = 0x102831A1; |
|
85 static const TUid KTestPlugin01Des_1Uid = {KTestPlugin01Des_1}; |
|
86 static const TSymmetricCipherCharacteristics KDes_1 = |
|
87 { |
|
88 KSymmetricCipherInterface, |
|
89 KAlgorithmCipherDes, |
|
90 KTestPlugin01Des_1, |
|
91 &KSymbianTestFramework, |
|
92 EFalse, |
|
93 EFalse, |
|
94 6, |
|
95 &KDesDescription, |
|
96 100, |
|
97 90, |
|
98 32, |
|
99 64, |
|
100 KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), |
|
101 KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32), |
|
102 3 |
|
103 }; |
|
104 |
|
105 /** |
|
106 Test Plugin 01 - Symmetric Cipher DES 2 |
|
107 */ |
|
108 static const TInt32 KTestPlugin01Des_2 = 0x102831A2; |
|
109 static const TUid KTestPlugin01Des_2Uid = {KTestPlugin01Des_2}; |
|
110 static const TSymmetricCipherCharacteristics KDes_2 = |
|
111 { |
|
112 KSymmetricCipherInterface, |
|
113 KAlgorithmCipherDes, |
|
114 KTestPlugin01Des_2, |
|
115 &KSymbianTestFramework, |
|
116 EFalse, |
|
117 ETrue, |
|
118 5, |
|
119 &KDesDescription, |
|
120 100, |
|
121 200, |
|
122 64, |
|
123 64, |
|
124 KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), |
|
125 KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32), |
|
126 3 |
|
127 }; |
|
128 |
|
129 /** |
|
130 Test Plugin 01 - Symmetric Cipher DES 3 |
|
131 */ |
|
132 static const TInt32 KTestPlugin01Des_3 = 0x102831A3; |
|
133 static const TUid KTestPlugin01Des_3Uid = {KTestPlugin01Des_3}; |
|
134 static const TSymmetricCipherCharacteristics KDes_3 = |
|
135 { |
|
136 KSymmetricCipherInterface, |
|
137 KAlgorithmCipherDes, |
|
138 KTestPlugin01Des_3, |
|
139 &KSymbianTestFramework, |
|
140 ETrue, |
|
141 EFalse, |
|
142 7, |
|
143 &KDesDescription, |
|
144 100, |
|
145 90, |
|
146 128, |
|
147 128, |
|
148 KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), |
|
149 KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32), |
|
150 3 |
|
151 }; |
|
152 |
|
153 /** |
|
154 Test Plugin 01 - Symmetric Cipher DES 4 |
|
155 */ |
|
156 static const TInt32 KTestPlugin01Des_4 = 0x102831A4; |
|
157 static const TUid KTestPlugin01Des_4Uid = {KTestPlugin01Des_4}; |
|
158 static const TSymmetricCipherCharacteristics KDes_4 = |
|
159 { |
|
160 KSymmetricCipherInterface, |
|
161 KAlgorithmCipherDes, |
|
162 KTestPlugin01Des_4, |
|
163 &KSymbianTestFramework, |
|
164 EFalse, |
|
165 EFalse, |
|
166 6, |
|
167 &KDesDescription, |
|
168 50, |
|
169 90, |
|
170 64, |
|
171 64, |
|
172 KDesPaddingModes, sizeof(KDesPaddingModes)/sizeof(TInt32), |
|
173 KDesCryptoModes, sizeof(KDesCryptoModes)/sizeof(TInt32), |
|
174 2 |
|
175 }; |
|
176 |
|
177 /** |
|
178 Test Plugin 01 - Hash MD2 1 |
|
179 */ |
|
180 static const TInt32 KTestPlugin01Md2_1 = 0x102831A5; |
|
181 static const TUid KTestPlugin01Md2_1Uid = {KTestPlugin01Md2_1}; |
|
182 static const THashCharacteristics KMd2_1 = |
|
183 { |
|
184 KHashInterface, |
|
185 KAlgorithmHashMd2, |
|
186 KTestPlugin01Md2_1, |
|
187 &KSymbianTestFramework, |
|
188 EFalse, |
|
189 EFalse, |
|
190 6, |
|
191 &KMd2Description, |
|
192 100, |
|
193 85, |
|
194 192, |
|
195 64, |
|
196 KHashOperationModes, sizeof(KHashOperationModes)/sizeof(TInt32) |
|
197 }; |
|
198 |
|
199 /** |
|
200 Test Plugin 01 - Hash MD2 2 |
|
201 */ |
|
202 static const TInt32 KTestPlugin01Md2_2 = 0x102831A6; |
|
203 static const TUid KTestPlugin01Md2_2Uid = {KTestPlugin01Md2_2}; |
|
204 static const THashCharacteristics KMd2_2 = |
|
205 { |
|
206 KHashInterface, |
|
207 KAlgorithmHashMd2, |
|
208 KTestPlugin01Md2_2, |
|
209 &KAlternativeName, |
|
210 EFalse, |
|
211 EFalse, |
|
212 6, |
|
213 &KMd2Description, |
|
214 100, |
|
215 90, |
|
216 256, |
|
217 256, |
|
218 KHashOperationModes, sizeof(KHashOperationModes)/sizeof(TInt32) |
|
219 }; |
|
220 |
|
221 /** |
|
222 Test Plugin 01 - RSA Key Generator 1 |
|
223 */ |
|
224 static const TInt32 KTestPlugin01RsaKeyGen_1 = 0x102831A7; |
|
225 static const TUid KTestPlugin01RsaKeyGen_1Uid={KTestPlugin01RsaKeyGen_1}; |
|
226 static const TAsymmetricKeypairGeneratorCharacteristics KRSAKeyPairGenerator_1 = |
|
227 { |
|
228 KKeypairGeneratorInterface, |
|
229 KAlgorithmRSAKeyPairGenerator, |
|
230 KTestPlugin01RsaKeyGen_1, |
|
231 &KSymbianTestFramework, |
|
232 EFalse, |
|
233 EFalse, |
|
234 6, |
|
235 &KKeyPairDescription, |
|
236 99, |
|
237 90, |
|
238 2048 |
|
239 }; |
|
240 |
|
241 /** |
|
242 Test Plugin 01 - RSA verifier 1 |
|
243 */ |
|
244 static const TInt32 KTestPlugin01RsaVerifier_1 = 0x102831A8; |
|
245 static const TUid KTestPlugin01RsaVerifier_1Uid={KTestPlugin01RsaVerifier_1}; |
|
246 static const TAsymmetricSignatureCharacteristics KRSAVerifier_1 = |
|
247 { |
|
248 KVerifierInterface, |
|
249 KAlgorithmVerifierRsa, |
|
250 KTestPlugin01RsaVerifier_1, |
|
251 &KSymbianTestFramework, |
|
252 EFalse, |
|
253 EFalse, |
|
254 6, |
|
255 &KRsaVerifierDescription, |
|
256 100, |
|
257 90, |
|
258 256, |
|
259 KRSAVerifierPaddingModes, sizeof(KRSAVerifierPaddingModes)/sizeof(KRSAVerifierPaddingModes[0]), |
|
260 2}; |
|
261 |
|
262 /** |
|
263 Test Plugin 01 - RSA verifier 2 |
|
264 */ |
|
265 static const TInt32 KTestPlugin01RsaVerifier_2 = 0x102831A9; |
|
266 static const TUid KTestPlugin01RsaVerifier_2Uid={KTestPlugin01RsaVerifier_2}; |
|
267 static const TAsymmetricSignatureCharacteristics KRSAVerifier_2 = |
|
268 { |
|
269 KVerifierInterface, |
|
270 KAlgorithmVerifierRsa, |
|
271 KTestPlugin01RsaVerifier_2, |
|
272 &KSymbianTestFramework, |
|
273 EFalse, |
|
274 EFalse, |
|
275 6, |
|
276 &KRsaVerifierDescription, |
|
277 100, |
|
278 90, |
|
279 192, |
|
280 KRSAVerifierPaddingModes, sizeof(KRSAVerifierPaddingModes)/sizeof(KRSAVerifierPaddingModes[0]), |
|
281 3}; |
|
282 |
|
283 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT |
|
284 /** |
|
285 Test Plugin 01 - AES |
|
286 */ |
|
287 static const TInt32 KTestPlugin01Aes = 0x102831AA; |
|
288 static const TUid KTestPlugin01AesUid={KTestPlugin01Aes}; |
|
289 static const TInt32 KTestPlugin01AesPaddingModes[]={KPaddingModeNone, KPaddingModeSSLv3, KPaddingModePKCS7}; |
|
290 static const TInt32 KTestPlugin01AesCryptoModes[]={KOperationModeNone, KOperationModeECB, KOperationModeCBC, KOperationModeCTR}; |
|
291 |
|
292 static const TSymmetricCipherCharacteristics KAes_1 = |
|
293 { |
|
294 KSymmetricCipherInterface, |
|
295 KAlgorithmCipherAes, |
|
296 KTestPlugin01Aes, |
|
297 &KAlternativeName, |
|
298 EFalse, |
|
299 EFalse, |
|
300 6, |
|
301 &KAesDescription, |
|
302 100, |
|
303 90, |
|
304 256 /* max key bits */, |
|
305 128 /* block bits */, |
|
306 KTestPlugin01AesPaddingModes, |
|
307 sizeof(KTestPlugin01AesPaddingModes)/sizeof(KTestPlugin01AesPaddingModes[0]), |
|
308 KTestPlugin01AesCryptoModes, sizeof(KTestPlugin01AesCryptoModes)/sizeof(KTestPlugin01AesCryptoModes[0]), |
|
309 3 |
|
310 }; |
|
311 |
|
312 /** |
|
313 Test Plugin 01 - AesXcbcMac96 |
|
314 */ |
|
315 static const TInt32 KTestPlugin01XcbcMac96 = 0x102831AB; |
|
316 static const TUid KTestPlugin01XcbcMac96Uid = {KTestPlugin01XcbcMac96}; |
|
317 static const TMacCharacteristics KXcbcMac96Char = |
|
318 { |
|
319 KMacInterface, |
|
320 KAlgorithmCipherAesXcbcMac96, |
|
321 KTestPlugin01XcbcMac96, |
|
322 &KAlternativeName, |
|
323 EFalse, |
|
324 EFalse, |
|
325 6, |
|
326 &KAesXcbcMac96Description, |
|
327 100, |
|
328 90, |
|
329 KSymmetricCipherMode, |
|
330 0, |
|
331 &KAes_1 |
|
332 }; |
|
333 |
|
334 /** |
|
335 Test Plugin 01 - Mac MD2 1 |
|
336 */ |
|
337 static const TInt32 KTestPlugin01MacMd2_1 = 0x102831AC; |
|
338 static const TUid KTestPlugin01MacMd2_1Uid = {KTestPlugin01MacMd2_1}; |
|
339 static const TMacCharacteristics KMacMd2_1 = |
|
340 { |
|
341 KMacInterface, |
|
342 KAlgorithmHashMd2, |
|
343 KTestPlugin01MacMd2_1, |
|
344 &KAlternativeName, |
|
345 EFalse, |
|
346 EFalse, |
|
347 2, |
|
348 &KHmacMd2Description, |
|
349 20, |
|
350 70, |
|
351 KHmacMode, |
|
352 &KMd2_1, |
|
353 0 |
|
354 }; |
|
355 |
|
356 /** |
|
357 Test Plugin 01 - Mac MD2 2 |
|
358 */ |
|
359 static const TInt32 KTestPlugin01MacMd2_2 = 0x102831AD; |
|
360 static const TUid KTestPlugin01MacMd2_2Uid = {KTestPlugin01MacMd2_2}; |
|
361 static const TMacCharacteristics KMacMd2_2 = |
|
362 { |
|
363 KMacInterface, |
|
364 KAlgorithmHashMd2, |
|
365 KTestPlugin01MacMd2_2, |
|
366 &KAlternativeName, |
|
367 EFalse, |
|
368 EFalse, |
|
369 6, |
|
370 &KHmacMd2Description, |
|
371 100, |
|
372 90, |
|
373 KHmacMode, |
|
374 &KMd2_2, |
|
375 0 |
|
376 }; |
|
377 #endif |
|
378 |
|
379 /** |
|
380 Symmetric Cipher implemetation characteristic table |
|
381 */ |
|
382 static const TSymmetricCipherCharacteristics* const KSymmetricCipherCharacteristics[]= |
|
383 { |
|
384 &KDes_1, &KDes_2, &KDes_3, &KDes_4 |
|
385 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT |
|
386 , &KAes_1 |
|
387 #endif |
|
388 }; |
|
389 |
|
390 /** |
|
391 Hash implemetation characteristic table |
|
392 */ |
|
393 static const THashCharacteristics* const KHashCharacteristics[] = |
|
394 { |
|
395 &KMd2_1, &KMd2_2 |
|
396 }; |
|
397 |
|
398 /** |
|
399 Key pair generator implementation characteristic table |
|
400 */ |
|
401 static const TAsymmetricKeypairGeneratorCharacteristics* const KKeyPairGeneratorCharacteristics[]= |
|
402 { |
|
403 &KRSAKeyPairGenerator_1 |
|
404 }; |
|
405 |
|
406 /** |
|
407 Verifier implementation characteristic table |
|
408 */ |
|
409 static const TAsymmetricSignatureCharacteristics* const KVerifierCharacteristics[]= |
|
410 { |
|
411 &KRSAVerifier_1, &KRSAVerifier_2 |
|
412 }; |
|
413 |
|
414 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT |
|
415 static const TMacCharacteristics* const KMacCharacteristics[]= |
|
416 { |
|
417 &KXcbcMac96Char, &KMacMd2_1, &KMacMd2_2 |
|
418 }; |
|
419 #endif |
|
420 } |
|
421 |
|
422 #endif //__CRYPTOAPI_SOFTWAREPLUGINCONFIG_H__ |