- if (direction == ENCRYPT)
- {
- if (op->flags & VNET_CRYPTO_OP_FLAG_INIT_IV)
- {
- iv = ptd->cbc_iv;
- // only use 8 bytes of the IV
- clib_memcpy_fast (op->iv, &iv, 8);
- ptd->cbc_iv = _mm_aesenc_si128 (iv, iv);
- }
- nonce[0] = op->salt;
- clib_memcpy_fast (nonce + 1, op->iv, 8);
- job->iv = (u8 *) nonce;
- }
- else
- {
- nonce[0] = op->salt;
- clib_memcpy_fast (nonce + 1, op->iv, 8);
- job->iv = op->iv;
- }
-