Lines Matching refs:mac

45 	mac = NULL;  in setUp()
51 if (mac != NULL) in tearDown()
53 CryptoFactory::i()->recycleMacAlgorithm(mac); in tearDown()
66 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_MD5)) != NULL); in testHMACMD5()
78 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACMD5()
79 CPPUNIT_ASSERT(mac->signUpdate(b)); in testHMACMD5()
80 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACMD5()
87 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACMD5()
88 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, 567))); in testHMACMD5()
89 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567, 989))); in testHMACMD5()
90 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567 + 989))); in testHMACMD5()
91 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACMD5()
95 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACMD5()
97 mac = NULL; in testHMACMD5()
108 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_SHA1)) != NULL); in testHMACSHA1()
120 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA1()
121 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testHMACSHA1()
122 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA1()
125 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA1()
126 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, 567))); in testHMACSHA1()
127 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567, 989))); in testHMACSHA1()
128 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567 + 989))); in testHMACSHA1()
129 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA1()
135 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA1()
136 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, 567))); in testHMACSHA1()
137 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567, 989))); in testHMACSHA1()
138 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567 + 989))); in testHMACSHA1()
139 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA1()
143 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACSHA1()
145 mac = NULL; in testHMACSHA1()
155 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_SHA224)) != NULL); in testHMACSHA224()
167 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA224()
168 CPPUNIT_ASSERT(mac->signUpdate(b)); in testHMACSHA224()
169 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA224()
174 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA224()
175 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, 567))); in testHMACSHA224()
176 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567, 989))); in testHMACSHA224()
177 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567 + 989))); in testHMACSHA224()
178 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA224()
182 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA224()
183 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, 567))); in testHMACSHA224()
184 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567, 989))); in testHMACSHA224()
185 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567 + 989))); in testHMACSHA224()
186 CPPUNIT_ASSERT(!mac->verifyFinal(osslMac)); in testHMACSHA224()
188 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACSHA224()
190 mac = NULL; in testHMACSHA224()
200 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_SHA256)) != NULL); in testHMACSHA256()
212 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA256()
213 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testHMACSHA256()
214 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA256()
217 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA256()
218 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, 567))); in testHMACSHA256()
219 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567, 989))); in testHMACSHA256()
220 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567 + 989))); in testHMACSHA256()
221 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA256()
225 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA256()
226 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testHMACSHA256()
227 CPPUNIT_ASSERT(!mac->verifyFinal(osslMac)); in testHMACSHA256()
229 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACSHA256()
231 mac = NULL; in testHMACSHA256()
241 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_SHA384)) != NULL); in testHMACSHA384()
253 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA384()
254 CPPUNIT_ASSERT(mac->signUpdate(b)); in testHMACSHA384()
255 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA384()
262 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA384()
263 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, 567))); in testHMACSHA384()
264 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567, 989))); in testHMACSHA384()
265 CPPUNIT_ASSERT(mac->signUpdate(b.substr(567 + 989))); in testHMACSHA384()
266 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA384()
272 CPPUNIT_ASSERT(mac->signInit(&key)); in testHMACSHA384()
273 CPPUNIT_ASSERT(mac->signUpdate(b)); in testHMACSHA384()
274 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testHMACSHA384()
278 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACSHA384()
280 mac = NULL; in testHMACSHA384()
290 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::HMAC_SHA512)) != NULL); in testHMACSHA512()
302 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA512()
303 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testHMACSHA512()
304 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA512()
307 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testHMACSHA512()
308 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, 567))); in testHMACSHA512()
309 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567, 989))); in testHMACSHA512()
310 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(567 + 989))); in testHMACSHA512()
311 CPPUNIT_ASSERT(mac->verifyFinal(osslMac)); in testHMACSHA512()
313 CryptoFactory::i()->recycleMacAlgorithm(mac); in testHMACSHA512()
315 mac = NULL; in testHMACSHA512()
343 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::CMAC_DES)) != NULL); in testCMACDES2()
359 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACDES2()
360 CPPUNIT_ASSERT(mac->signUpdate(b)); in testCMACDES2()
361 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACDES2()
365 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACDES2()
366 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testCMACDES2()
367 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACDES2()
374 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACDES2()
375 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, part1))); in testCMACDES2()
376 CPPUNIT_ASSERT(mac->signUpdate(b.substr(part2))); in testCMACDES2()
377 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACDES2()
381 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACDES2()
382 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, part1))); in testCMACDES2()
383 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(part2))); in testCMACDES2()
384 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACDES2()
387 CryptoFactory::i()->recycleMacAlgorithm(mac); in testCMACDES2()
389 mac = NULL; in testCMACDES2()
417 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::CMAC_DES)) != NULL); in testCMACDES3()
433 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACDES3()
434 CPPUNIT_ASSERT(mac->signUpdate(b)); in testCMACDES3()
435 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACDES3()
439 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACDES3()
440 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testCMACDES3()
441 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACDES3()
448 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACDES3()
449 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, part1))); in testCMACDES3()
450 CPPUNIT_ASSERT(mac->signUpdate(b.substr(part2))); in testCMACDES3()
451 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACDES3()
455 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACDES3()
456 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, part1))); in testCMACDES3()
457 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(part2))); in testCMACDES3()
458 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACDES3()
461 CryptoFactory::i()->recycleMacAlgorithm(mac); in testCMACDES3()
463 mac = NULL; in testCMACDES3()
491 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::CMAC_AES)) != NULL); in testCMACAES128()
507 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES128()
508 CPPUNIT_ASSERT(mac->signUpdate(b)); in testCMACAES128()
509 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES128()
513 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES128()
514 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testCMACAES128()
515 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES128()
522 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES128()
523 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, part1))); in testCMACAES128()
524 CPPUNIT_ASSERT(mac->signUpdate(b.substr(part2))); in testCMACAES128()
525 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES128()
529 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES128()
530 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, part1))); in testCMACAES128()
531 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(part2))); in testCMACAES128()
532 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES128()
535 CryptoFactory::i()->recycleMacAlgorithm(mac); in testCMACAES128()
537 mac = NULL; in testCMACAES128()
565 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::CMAC_AES)) != NULL); in testCMACAES192()
581 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES192()
582 CPPUNIT_ASSERT(mac->signUpdate(b)); in testCMACAES192()
583 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES192()
587 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES192()
588 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testCMACAES192()
589 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES192()
596 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES192()
597 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, part1))); in testCMACAES192()
598 CPPUNIT_ASSERT(mac->signUpdate(b.substr(part2))); in testCMACAES192()
599 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES192()
603 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES192()
604 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, part1))); in testCMACAES192()
605 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(part2))); in testCMACAES192()
606 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES192()
609 CryptoFactory::i()->recycleMacAlgorithm(mac); in testCMACAES192()
611 mac = NULL; in testCMACAES192()
639 CPPUNIT_ASSERT((mac = CryptoFactory::i()->getMacAlgorithm(MacAlgo::CMAC_AES)) != NULL); in testCMACAES256()
655 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES256()
656 CPPUNIT_ASSERT(mac->signUpdate(b)); in testCMACAES256()
657 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES256()
661 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES256()
662 CPPUNIT_ASSERT(mac->verifyUpdate(b)); in testCMACAES256()
663 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES256()
670 CPPUNIT_ASSERT(mac->signInit(&key)); in testCMACAES256()
671 CPPUNIT_ASSERT(mac->signUpdate(b.substr(0, part1))); in testCMACAES256()
672 CPPUNIT_ASSERT(mac->signUpdate(b.substr(part2))); in testCMACAES256()
673 CPPUNIT_ASSERT(mac->signFinal(shsmMac)); in testCMACAES256()
677 CPPUNIT_ASSERT(mac->verifyInit(&key)); in testCMACAES256()
678 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(0, part1))); in testCMACAES256()
679 CPPUNIT_ASSERT(mac->verifyUpdate(b.substr(part2))); in testCMACAES256()
680 CPPUNIT_ASSERT(mac->verifyFinal(nistMac)); in testCMACAES256()
683 CryptoFactory::i()->recycleMacAlgorithm(mac); in testCMACAES256()
685 mac = NULL; in testCMACAES256()