----------------------------------------------------------------------------- Purpose: Performs specified # of symmetric descryptions -----------------------------------------------------------------------------
| 717 | // Purpose: Performs specified # of symmetric descryptions |
| 718 | //----------------------------------------------------------------------------- |
| 719 | void SymmetricAuthDecryptRepeatedly( int cIterations, AES_GCM_DecryptContext &ctxDec, uint8 *pubEncrypted, int cubEncrypted, uint8 *pubIV ) |
| 720 | { |
| 721 | int nBufSize = cubEncrypted + 32; // 16 = AES block size.. worst case for padded data |
| 722 | uint8 *pDecrypted = new uint8[ nBufSize ]; |
| 723 | |
| 724 | // try a bunch of iterations of symmetric encrypting big packets |
| 725 | for ( int iIteration = 0; iIteration < cIterations; iIteration++ ) |
| 726 | { |
| 727 | uint cubOutput = nBufSize; |
| 728 | bool bRet = ctxDec.Decrypt( |
| 729 | pubEncrypted, cubEncrypted, |
| 730 | pubIV, |
| 731 | pDecrypted, &cubOutput, |
| 732 | nullptr, 0 ); |
| 733 | CHECK( bRet ); // must succeed |
| 734 | } |
| 735 | |
| 736 | delete [] pDecrypted; |
| 737 | } |
| 738 | |
| 739 | //----------------------------------------------------------------------------- |
| 740 | // Purpose: Tests symmetric crypto perf |
no test coverage detected