----------------------------------------------------------------------------- Purpose: Performs specified # of symmetric encryptions -----------------------------------------------------------------------------
| 694 | // Purpose: Performs specified # of symmetric encryptions |
| 695 | //----------------------------------------------------------------------------- |
| 696 | void SymmetricAuthEncryptRepeatedly( int cIterations, AES_GCM_EncryptContext &ctxEnc, uint8 *pubData, int cubToEncrypt, uint8 *pubIV ) |
| 697 | { |
| 698 | int nBufSize = cubToEncrypt + 32; // 16 = AES block size.. worst case for padded data |
| 699 | uint8 *pEncrypted = new uint8[ nBufSize ]; |
| 700 | |
| 701 | // try a bunch of iterations of symmetric encrypting big packets |
| 702 | for ( int iIteration = 0; iIteration < cIterations; iIteration++ ) |
| 703 | { |
| 704 | uint cubEncrypted = nBufSize; |
| 705 | bool bRet = ctxEnc.Encrypt( |
| 706 | &pubData[iIteration], cubToEncrypt, |
| 707 | pubIV, |
| 708 | pEncrypted, &cubEncrypted, |
| 709 | nullptr, 0 ); |
| 710 | CHECK( bRet ); // must succeed |
| 711 | } |
| 712 | |
| 713 | delete [] pEncrypted; |
| 714 | } |
| 715 | |
| 716 | //----------------------------------------------------------------------------- |
| 717 | // Purpose: Performs specified # of symmetric descryptions |
no test coverage detected