- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
- ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA256_HMAC;
- ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA256;
- ut_params->auth_xform.auth.key.data = hmac_sha256_key;
- ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
-
- /* Create Crypto session*/
- ut_params->sess = rte_cryptodev_sym_session_create(
- ts_params->valid_devs[0],
- &ut_params->cipher_xform);
- TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
- /* Generate Crypto op data structure */
- ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC);
- TEST_ASSERT_NOT_NULL(ut_params->op,
- "Failed to allocate symmetric crypto operation struct");
-
- rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
- struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
- /* set crypto operation source mbuf */
- sym_op->m_src = ut_params->ibuf;
-
- sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
- ut_params->ibuf, QUOTE_512_BYTES);
- sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
-
- sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->auth.data.length = QUOTE_512_BYTES;
-
- sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
- CIPHER_IV_LENGTH_AES_CBC);
- sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
- sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
-
- rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
- CIPHER_IV_LENGTH_AES_CBC);
-
- sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->cipher.data.length = QUOTE_512_BYTES;
-
- /* Process crypto operation */
- TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
- ut_params->op), "failed to process sym crypto op");
-
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "crypto op processing failed");
-
- ut_params->obuf = ut_params->op->sym->m_src;
-
- /* Validate obuf */
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC,
- catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
- QUOTE_512_BYTES,
- "Ciphertext data not as expected");
-
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
- catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA256_digest,
- gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD ?
- TRUNCATED_DIGEST_BYTE_LENGTH_SHA256 :
- DIGEST_BYTE_LENGTH_SHA256,
- "Generated digest data not as expected");
-
-
- return TEST_SUCCESS;
-}
-
-static int
-test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
-{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
- struct crypto_unittest_params *ut_params = &unittest_params;
-
- /* Generate test mbuf data and digest */
- ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
- (const char *)
- catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
- QUOTE_512_BYTES, 0);
-
- ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
- DIGEST_BYTE_LENGTH_SHA256);
- TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
- rte_memcpy(ut_params->digest,
- catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA256_digest,
- DIGEST_BYTE_LENGTH_SHA256);
-
- /* Setup Cipher Parameters */
- ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
- ut_params->cipher_xform.next = NULL;
-
- ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
- ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT;
- ut_params->cipher_xform.cipher.key.data = aes_cbc_key;
- ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
-
- /* Setup HMAC Parameters */
- ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
- ut_params->auth_xform.next = &ut_params->cipher_xform;
-
- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
- ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA256_HMAC;
- ut_params->auth_xform.auth.key.data = hmac_sha256_key;
- ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA256;
- ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
-
- /* Create Crypto session*/
- ut_params->sess =
- rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
- &ut_params->auth_xform);
- TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
- /* Generate Crypto op data structure */
- ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC);
- TEST_ASSERT_NOT_NULL(ut_params->op,
- "Failed to allocate symmetric crypto operation struct");
-
-
- /* Set crypto operation data parameters */
- rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
- struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
- /* set crypto operation source mbuf */
- sym_op->m_src = ut_params->ibuf;
-
- sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
- ut_params->ibuf, QUOTE_512_BYTES);
- sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
-
- sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->auth.data.length = QUOTE_512_BYTES;
-
- sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
- ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
- sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
- sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
-
- rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
- CIPHER_IV_LENGTH_AES_CBC);
-
- sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->cipher.data.length = QUOTE_512_BYTES;
-
- /* Process crypto operation */
- TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
- ut_params->op), "failed to process sym crypto op");
-
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "crypto op processing failed");
-
- ut_params->obuf = ut_params->op->sym->m_src;
-
- /* Validate obuf */
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC, catch_22_quote,
- QUOTE_512_BYTES,
- "Plaintext data not as expected");
-
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "Digest verification failed");
-
- return TEST_SUCCESS;
-}
-
-/* ***** AES-CBC / HMAC-SHA512 Hash Tests ***** */
-
-#define HMAC_KEY_LENGTH_SHA512 (DIGEST_BYTE_LENGTH_SHA512)
-
-static uint8_t hmac_sha512_key[] = {
- 0x42, 0x1a, 0x7d, 0x3d, 0xf5, 0x82, 0x80, 0xf1,
- 0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,
- 0x58, 0x34, 0x85, 0x65, 0x1C, 0x42, 0x50, 0x76,
- 0x9a, 0xaf, 0x88, 0x1b, 0xb6, 0x8f, 0xf8, 0x60,
- 0xa2, 0x5a, 0x7f, 0x3f, 0xf4, 0x72, 0x70, 0xf1,
- 0xF5, 0x35, 0x4C, 0x3B, 0xDD, 0x90, 0x65, 0xB0,
- 0x47, 0x3a, 0x75, 0x61, 0x5C, 0xa2, 0x10, 0x76,
- 0x9a, 0xaf, 0x77, 0x5b, 0xb6, 0x7f, 0xf7, 0x60 };
-
-static const uint8_t catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA512_digest[] = {
- 0x5D, 0x54, 0x66, 0xC1, 0x6E, 0xBC, 0x04, 0xB8,
- 0x46, 0xB8, 0x08, 0x6E, 0xE0, 0xF0, 0x43, 0x48,
- 0x37, 0x96, 0x9C, 0xC6, 0x9C, 0xC2, 0x1E, 0xE8,
- 0xF2, 0x0C, 0x0B, 0xEF, 0x86, 0xA2, 0xE3, 0x70,
- 0x95, 0xC8, 0xB3, 0x06, 0x47, 0xA9, 0x90, 0xE8,
- 0xA0, 0xC6, 0x72, 0x69, 0x05, 0xC0, 0x0D, 0x0E,
- 0x21, 0x96, 0x65, 0x93, 0x74, 0x43, 0x2A, 0x1D,
- 0x2E, 0xBF, 0xC2, 0xC2, 0xEE, 0xCC, 0x2F, 0x0A };
-
-static int
-test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
-{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
- struct crypto_unittest_params *ut_params = &unittest_params;
-
- /* Generate test mbuf data and space for digest */
- ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
- catch_22_quote, QUOTE_512_BYTES, 0);
-
- ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
- DIGEST_BYTE_LENGTH_SHA512);
- TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
- /* Setup Cipher Parameters */
- ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
- ut_params->cipher_xform.next = &ut_params->auth_xform;
-
- ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
- ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
- ut_params->cipher_xform.cipher.key.data = aes_cbc_key;
- ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
-
- /* Setup HMAC Parameters */
- ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
- ut_params->auth_xform.next = NULL;
-
- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
- ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA512_HMAC;
- ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512;
- ut_params->auth_xform.auth.key.data = hmac_sha512_key;
- ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
-
- /* Create Crypto session*/
- ut_params->sess =
- rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
- &ut_params->cipher_xform);
-
- TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
- /* Generate Crypto op data structure */
- ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC);
- TEST_ASSERT_NOT_NULL(ut_params->op,
- "Failed to allocate symmetric crypto operation struct");
-
- rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
- struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
- /* set crypto operation source mbuf */
- sym_op->m_src = ut_params->ibuf;
-
- sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
- ut_params->ibuf, QUOTE_512_BYTES);
- sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
-
- sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->auth.data.length = QUOTE_512_BYTES;
-
- sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
- CIPHER_IV_LENGTH_AES_CBC);
- sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
- sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
-
- rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
- CIPHER_IV_LENGTH_AES_CBC);
-
- sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->cipher.data.length = QUOTE_512_BYTES;
-
- /* Process crypto operation */
- TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
- ut_params->op), "failed to process sym crypto op");
-
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "crypto op processing failed");
-
- ut_params->obuf = ut_params->op->sym->m_src;
-
- /* Validate obuf */
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC,
- catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
- QUOTE_512_BYTES,
- "Ciphertext data not as expected");
-
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
- catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA512_digest,
- gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD ?
- TRUNCATED_DIGEST_BYTE_LENGTH_SHA512 :
- DIGEST_BYTE_LENGTH_SHA512,
- "Generated digest data not as expected");
-
- return TEST_SUCCESS;
-}
-
-
-static int
-test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
- struct crypto_unittest_params *ut_params);
-
-static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
- struct crypto_unittest_params *ut_params,
- struct crypto_testsuite_params *ts_params);
-
-static int
-test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
-{
- struct crypto_unittest_params *ut_params = &unittest_params;
- struct crypto_testsuite_params *ts_params = &testsuite_params;
-
- TEST_ASSERT(test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
- ut_params) == TEST_SUCCESS,
- "Failed to create session params");
-
- /* Create Crypto session*/
- ut_params->sess =
- rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
- &ut_params->auth_xform);
- TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
- return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
- ut_params, ts_params);
-}
-
-static int
-test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
- struct crypto_unittest_params *ut_params)
-{
-
- /* Setup Cipher Parameters */
- ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
- ut_params->cipher_xform.next = NULL;
-
- ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
- ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT;
- ut_params->cipher_xform.cipher.key.data = aes_cbc_key;
- ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
-
- /* Setup HMAC Parameters */
- ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
- ut_params->auth_xform.next = &ut_params->cipher_xform;
-
- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
- ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA512_HMAC;
- ut_params->auth_xform.auth.key.data = hmac_sha512_key;
- ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512;
- ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
-
- return TEST_SUCCESS;
-}
-
-
-static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
- struct crypto_unittest_params *ut_params,
- struct crypto_testsuite_params *ts_params)
-{
- /* Generate test mbuf data and digest */
- ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
- (const char *)
- catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
- QUOTE_512_BYTES, 0);
-
- ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
- DIGEST_BYTE_LENGTH_SHA512);
- TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
- rte_memcpy(ut_params->digest,
- catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA512_digest,
- DIGEST_BYTE_LENGTH_SHA512);
-
- /* Generate Crypto op data structure */
- ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC);
- TEST_ASSERT_NOT_NULL(ut_params->op,
- "Failed to allocate symmetric crypto operation struct");
-
- rte_crypto_op_attach_sym_session(ut_params->op, sess);
-
- struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
- /* set crypto operation source mbuf */
- sym_op->m_src = ut_params->ibuf;
-
- sym_op->auth.digest.data = ut_params->digest;
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
- ut_params->ibuf, QUOTE_512_BYTES);
- sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
-
- sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->auth.data.length = QUOTE_512_BYTES;
-
- sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
- ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
- sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(
- ut_params->ibuf, 0);
- sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
-
- rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
- CIPHER_IV_LENGTH_AES_CBC);
-
- sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->cipher.data.length = QUOTE_512_BYTES;
-
- /* Process crypto operation */
- TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
- ut_params->op), "failed to process sym crypto op");
-
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "crypto op processing failed");
-
- ut_params->obuf = ut_params->op->sym->m_src;
-
- /* Validate obuf */
- TEST_ASSERT_BUFFERS_ARE_EQUAL(
- rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
- CIPHER_IV_LENGTH_AES_CBC, catch_22_quote,
- QUOTE_512_BYTES,
- "Plaintext data not as expected");
-
- /* Validate obuf */
- TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
- "Digest verification failed");
-
- return TEST_SUCCESS;
-}
-
-/* ***** AES-CBC / HMAC-AES_XCBC Chain Tests ***** */
-
-static uint8_t aes_cbc_hmac_aes_xcbc_key[] = {
- 0x87, 0x61, 0x54, 0x53, 0xC4, 0x6D, 0xDD, 0x51,
- 0xE1, 0x9F, 0x86, 0x64, 0x39, 0x0A, 0xE6, 0x59
- };
-
-static const uint8_t catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest[] = {
- 0xE0, 0xAC, 0x9A, 0xC4, 0x22, 0x64, 0x35, 0x89,
- 0x77, 0x1D, 0x8B, 0x75
- };
-
-static int
-test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
-{
- struct crypto_testsuite_params *ts_params = &testsuite_params;
- struct crypto_unittest_params *ut_params = &unittest_params;
-
- /* Generate test mbuf data and space for digest */
- ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
- catch_22_quote, QUOTE_512_BYTES, 0);
-
- /* Setup Cipher Parameters */
- ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
- ut_params->cipher_xform.next = &ut_params->auth_xform;
-
- ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
- ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
- ut_params->cipher_xform.cipher.key.data = aes_cbc_key;
- ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
-
- /* Setup HMAC Parameters */
- ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
- ut_params->auth_xform.next = NULL;
-
- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
- ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC;
- ut_params->auth_xform.auth.key.length = AES_XCBC_MAC_KEY_SZ;
- ut_params->auth_xform.auth.key.data = aes_cbc_hmac_aes_xcbc_key;
- ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
-
- /* Create Crypto session*/
- ut_params->sess = rte_cryptodev_sym_session_create(
- ts_params->valid_devs[0],
- &ut_params->cipher_xform);
- TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
- /* Generate Crypto op data structure */
- ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC);
- TEST_ASSERT_NOT_NULL(ut_params->op,
- "Failed to allocate symmetric crypto operation struct");
-
- rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
- struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
- /* set crypto operation source mbuf */
- sym_op->m_src = ut_params->ibuf;
-
- /* Set operation cipher parameters */
- sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
- sym_op->m_src, CIPHER_IV_LENGTH_AES_CBC);
- sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(sym_op->m_src);
- sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
-
- rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
- CIPHER_IV_LENGTH_AES_CBC);
-
- sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->cipher.data.length = QUOTE_512_BYTES;
-
- /* Set operation authentication parameters */
- sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
- sym_op->m_src, DIGEST_BYTE_LENGTH_AES_XCBC);
- sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
- sym_op->m_src,
- CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES);
- sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_AES_XCBC;
-
- memset(sym_op->auth.digest.data, 0, DIGEST_BYTE_LENGTH_AES_XCBC);
-
- sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
- sym_op->auth.data.length = QUOTE_512_BYTES;