equal
deleted
inserted
replaced
21 // CLASS HEADER |
21 // CLASS HEADER |
22 #include "UT_CSRTPCipherAESCM128.h" |
22 #include "UT_CSRTPCipherAESCM128.h" |
23 |
23 |
24 // EXTERNAL INCLUDES |
24 // EXTERNAL INCLUDES |
25 #include <digia/eunit/eunitmacros.h> |
25 #include <digia/eunit/eunitmacros.h> |
|
26 #include <e32debug.h> |
26 |
27 |
27 // INTERNAL INCLUDES |
28 // INTERNAL INCLUDES |
28 #include "srtpcipher_aescm128.h" |
29 #include "srtpcipher_aescm128.h" |
29 #include "srtpdef.h" |
30 #include "srtpdef.h" |
30 |
31 |
210 CleanupStack::PushL(result); |
211 CleanupStack::PushL(result); |
211 |
212 |
212 EUNIT_ASSERT( result->Compare(*iRFC3686_TestCipherT256bits) == 0); |
213 EUNIT_ASSERT( result->Compare(*iRFC3686_TestCipherT256bits) == 0); |
213 |
214 |
214 CleanupStack::Pop(result); |
215 CleanupStack::Pop(result); |
215 delete result; |
216 delete result; |
216 } |
217 } |
217 |
218 |
218 void UT_CSRTPCipherAESCM128::UT_EncryptL_EncryptData3L( ) |
219 void UT_CSRTPCipherAESCM128::UT_EncryptL_EncryptData3L( ) |
219 { |
220 { |
220 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey_2_128bits, |
221 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey_2_128bits, |
241 |
242 |
242 CleanupStack::Pop(result); |
243 CleanupStack::Pop(result); |
243 delete result; |
244 delete result; |
244 } |
245 } |
245 |
246 |
|
247 void UT_CSRTPCipherAESCM128::UT_EncryptL_EncryptDataKeyChangesL( ) |
|
248 { |
|
249 UT_EncryptL_EncryptDataL(); |
|
250 UT_EncryptL_EncryptData2L(); |
|
251 } |
|
252 |
246 void UT_CSRTPCipherAESCM128::UT_EncryptL_DecryptDataL( ) |
253 void UT_CSRTPCipherAESCM128::UT_EncryptL_DecryptDataL( ) |
247 { |
254 { |
248 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey128bits, |
255 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey128bits, |
249 *iRFC3686_TestIV128bits, |
256 *iRFC3686_TestIV128bits, |
250 *iRFC3686_TestCipherT128bits); |
257 *iRFC3686_TestCipherT128bits); |
252 CleanupStack::PushL(result); |
259 CleanupStack::PushL(result); |
253 |
260 |
254 EUNIT_ASSERT( result->Compare(*iRFC3686_TestPlainT128bits) == 0); |
261 EUNIT_ASSERT( result->Compare(*iRFC3686_TestPlainT128bits) == 0); |
255 |
262 |
256 CleanupStack::Pop(result); |
263 CleanupStack::Pop(result); |
257 delete result; |
264 delete result; |
258 } |
265 } |
259 |
266 |
260 void UT_CSRTPCipherAESCM128::UT_EncryptL_DecryptData2L( ) |
267 void UT_CSRTPCipherAESCM128::UT_EncryptL_DecryptData2L( ) |
261 { |
268 { |
262 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey_2_128bits, |
269 HBufC8* result = iEncryptor->TransformL(*iRFC3686_TestKey_2_128bits, |
295 |
302 |
296 EUNIT_ASSERT( result->Compare(*iRFC3686_TestPlainT104bits) == 0); |
303 EUNIT_ASSERT( result->Compare(*iRFC3686_TestPlainT104bits) == 0); |
297 |
304 |
298 CleanupStack::Pop(result); |
305 CleanupStack::Pop(result); |
299 delete result; |
306 delete result; |
|
307 } |
|
308 |
|
309 void UT_CSRTPCipherAESCM128::UT_EncryptL_DecryptDataKeyChangesL( ) |
|
310 { |
|
311 UT_EncryptL_DecryptDataL(); |
|
312 UT_EncryptL_DecryptData2L(); |
300 } |
313 } |
301 |
314 |
302 void UT_CSRTPCipherAESCM128::UT_EncryptL_ErrorTest1L( ) |
315 void UT_CSRTPCipherAESCM128::UT_EncryptL_ErrorTest1L( ) |
303 { |
316 { |
304 TInt err = KErrNone; |
317 TInt err = KErrNone; |
415 "EncryptL", |
428 "EncryptL", |
416 "FUNCTIONALITY", |
429 "FUNCTIONALITY", |
417 SetupL, UT_EncryptL_EncryptData4L, Teardown) |
430 SetupL, UT_EncryptL_EncryptData4L, Teardown) |
418 |
431 |
419 EUNIT_TEST( |
432 EUNIT_TEST( |
|
433 "EncryptL encrypt data, key changes", |
|
434 "CSRTPCipherAESCM128", |
|
435 "EncryptL", |
|
436 "FUNCTIONALITY", |
|
437 SetupL, UT_EncryptL_EncryptDataKeyChangesL, Teardown) |
|
438 |
|
439 EUNIT_TEST( |
420 "EncryptL decrypt data", |
440 "EncryptL decrypt data", |
421 "CSRTPCipherAESCM128", |
441 "CSRTPCipherAESCM128", |
422 "EncryptL", |
442 "EncryptL", |
423 "FUNCTIONALITY", |
443 "FUNCTIONALITY", |
424 SetupL, UT_EncryptL_DecryptDataL, Teardown) |
444 SetupL, UT_EncryptL_DecryptDataL, Teardown) |
441 "EncryptL decrypt 4 data", |
461 "EncryptL decrypt 4 data", |
442 "CSRTPCipherAESCM128", |
462 "CSRTPCipherAESCM128", |
443 "EncryptL", |
463 "EncryptL", |
444 "FUNCTIONALITY", |
464 "FUNCTIONALITY", |
445 SetupL, UT_EncryptL_DecryptData4L, Teardown) |
465 SetupL, UT_EncryptL_DecryptData4L, Teardown) |
|
466 |
|
467 EUNIT_TEST( |
|
468 "EncryptL decrypt data, key changes", |
|
469 "CSRTPCipherAESCM128", |
|
470 "EncryptL", |
|
471 "FUNCTIONALITY", |
|
472 SetupL, UT_EncryptL_DecryptDataKeyChangesL, Teardown) |
446 |
473 |
447 EUNIT_TEST( |
474 EUNIT_TEST( |
448 "EncryptL error 1", |
475 "EncryptL error 1", |
449 "CSRTPCipherAESCM128", |
476 "CSRTPCipherAESCM128", |
450 "EncryptL", |
477 "EncryptL", |