Lines Matching defs:pContext
125 AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
126 pContext->m_bIV = true;
127 pContext->m_BlockOffset = 0;
128 CRYPT_AESSetKey(&pContext->m_Context, 16, m_EncryptKey, 32, bEncrypt);
131 pContext->m_Block[i] = (uint8_t)rand();
133 CRYPT_AESSetIV(&pContext->m_Context, pContext->m_Block);
135 return pContext;
151 AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
152 pContext->m_bIV = true;
153 pContext->m_BlockOffset = 0;
154 CRYPT_AESSetKey(&pContext->m_Context, 16, realkey, 16, bEncrypt);
157 pContext->m_Block[i] = (uint8_t)rand();
159 CRYPT_AESSetIV(&pContext->m_Context, pContext->m_Block);
161 return pContext;
163 CRYPT_rc4_context* pContext = FX_Alloc(CRYPT_rc4_context, 1);
164 CRYPT_ArcFourSetup(pContext, realkey, realkeylen);
165 return pContext;
187 AESCryptContext* pContext = reinterpret_cast<AESCryptContext*>(context);
188 if (pContext->m_bIV && bEncrypt) {
189 dest_buf.AppendBlock(pContext->m_Block, 16);
190 pContext->m_bIV = false;
195 uint32_t copy_size = 16 - pContext->m_BlockOffset;
199 memcpy(pContext->m_Block + pContext->m_BlockOffset, src_buf + src_off,
203 pContext->m_BlockOffset += copy_size;
204 if (pContext->m_BlockOffset == 16) {
205 if (!bEncrypt && pContext->m_bIV) {
206 CRYPT_AESSetIV(&pContext->m_Context, pContext->m_Block);
207 pContext->m_bIV = false;
208 pContext->m_BlockOffset = 0;
212 CRYPT_AESEncrypt(&pContext->m_Context, block_buf, pContext->m_Block,
215 CRYPT_AESDecrypt(&pContext->m_Context, block_buf, pContext->m_Block,
219 pContext->m_BlockOffset = 0;
241 AESCryptContext* pContext = (AESCryptContext*)context;
244 if (pContext->m_BlockOffset == 16) {
245 CRYPT_AESEncrypt(&pContext->m_Context, block_buf, pContext->m_Block, 16);
247 pContext->m_BlockOffset = 0;
249 memset(pContext->m_Block + pContext->m_BlockOffset,
250 (uint8_t)(16 - pContext->m_BlockOffset),
251 16 - pContext->m_BlockOffset);
252 CRYPT_AESEncrypt(&pContext->m_Context, block_buf, pContext->m_Block, 16);
254 } else if (pContext->m_BlockOffset == 16) {
256 CRYPT_AESDecrypt(&pContext->m_Context, block_buf, pContext->m_Block, 16);
261 FX_Free(pContext);