get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/11775/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 11775,
    "url": "http://patches.dpdk.org/api/patches/11775/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1459244349-20476-3-git-send-email-fiona.trahe@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1459244349-20476-3-git-send-email-fiona.trahe@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1459244349-20476-3-git-send-email-fiona.trahe@intel.com",
    "date": "2016-03-29T09:39:09",
    "name": "[dpdk-dev,2/2] app/test: added test for out-of-place symmetric operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "941971b71d938d9af18ea46581d5b41b1dd9e515",
    "submitter": {
        "id": 423,
        "url": "http://patches.dpdk.org/api/people/423/?format=api",
        "name": "Fiona Trahe",
        "email": "fiona.trahe@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1459244349-20476-3-git-send-email-fiona.trahe@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/11775/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/11775/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 77BAF567A;\n\tTue, 29 Mar 2016 11:48:59 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id D06715593\n\tfor <dev@dpdk.org>; Tue, 29 Mar 2016 11:48:56 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP; 29 Mar 2016 02:48:56 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 29 Mar 2016 02:48:55 -0700",
            "from linux.site (sisvmlab045.ir.intel.com [10.237.216.57])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tu2T9msaH014209; Tue, 29 Mar 2016 10:48:54 +0100",
            "by linux.site (Postfix, from userid 11342333)\n\tid 85A2DE3BBE; Tue, 29 Mar 2016 10:40:13 +0100 (IST)"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,410,1455004800\"; d=\"scan'208\";a=\"943564698\"",
        "From": "Fiona Trahe <fiona.trahe@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Declan.doherty@intel.com, Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "Date": "Tue, 29 Mar 2016 10:39:09 +0100",
        "Message-Id": "<1459244349-20476-3-git-send-email-fiona.trahe@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1459244349-20476-1-git-send-email-fiona.trahe@intel.com>",
        "References": "<1459244349-20476-1-git-send-email-fiona.trahe@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] app/test: added test for out-of-place\n\tsymmetric operations",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n\nAdded AES and snow3g Authenticated encryption and decryption tests\n\nSigned-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n---\n app/test/test_cryptodev.c |  495 ++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 491 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex 2494bae..0c26804 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -101,12 +101,27 @@ setup_test_string(struct rte_mempool *mpool,\n \t\t\trte_pktmbuf_free(m);\n \t\t\treturn NULL;\n \t\t}\n-\n-\t\trte_memcpy(dst, string, t_len);\n+\t\tif (string != NULL)\n+\t\t\trte_memcpy(dst, string, t_len);\n+\t\telse\n+\t\t\tmemset(dst, 0, t_len);\n \t}\n \n \treturn m;\n }\n+static int\n+setup_oop_test_mbufs(struct rte_mbuf **ibuf, struct rte_mbuf **obuf,\n+\t\tstruct rte_mempool *mpool,\tconst char *string, size_t len,\n+\t\tuint8_t blocksize) {\n+\t*ibuf = setup_test_string(mpool, string, len, blocksize);\n+\tif (*ibuf == NULL)\n+\t\treturn -(EFAULT);\n+\t*obuf = setup_test_string(mpool, NULL, len, blocksize);\n+\tif (*obuf == NULL)\n+\t\treturn -(EFAULT);\n+\n+\treturn 0;\n+}\n \n #if HEX_DUMP\n static void\n@@ -907,6 +922,241 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)\n \treturn TEST_SUCCESS;\n }\n \n+\n+static int\n+test_AES_CBC_HMAC_SHA1_encrypt_digest_oop(void)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tstruct crypto_unittest_params *ut_params = &unittest_params;\n+\n+\t/* Generate test mbuf data and space for digest */\n+\n+\tTEST_ASSERT_EQUAL(setup_oop_test_mbufs(&ut_params->ibuf,\n+\t\t\t&ut_params->obuf, ts_params->mbuf_pool, catch_22_quote,\n+\t\t\tQUOTE_512_BYTES, 0), 0,\n+\t\t\t\"Allocation of rte_mbuf failed\");\n+\n+\tut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->obuf,\n+\t\t\t\tDIGEST_BYTE_LENGTH_SHA1);\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->digest, \"no room to append digest\");\n+\n+\tut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\tut_params->cipher_xform.next = &ut_params->auth_xform;\n+\n+\tut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;\n+\tut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;\n+\tut_params->cipher_xform.cipher.key.data = aes_cbc_key;\n+\tut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;\n+\n+\tut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;\n+\tut_params->auth_xform.next = NULL;\n+\n+\tut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;\n+\tut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;\n+\tut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA1;\n+\tut_params->auth_xform.auth.key.data = hmac_sha1_key;\n+\tut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;\n+\n+\tut_params->sess = rte_cryptodev_sym_session_create(\n+\t\t\tts_params->valid_devs[0],\n+\t\t\t&ut_params->cipher_xform);\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->sess, \"Session creation failed\");\n+\n+\tut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->op,\n+\t\t\t\"Failed to allocate symmetric crypto operation struct\");\n+\n+\trte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);\n+\n+\tstruct rte_crypto_sym_op *sym_op = ut_params->op->sym;\n+\n+\t/* set crypto operation source mbuf */\n+\tsym_op->m_src = ut_params->ibuf;\n+\tsym_op->m_dst = ut_params->obuf;\n+\n+\tsym_op->auth.digest.data = ut_params->digest;\n+\n+\tsym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(\n+\t\t\tut_params->obuf, QUOTE_512_BYTES);\n+\n+\tsym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;\n+\tsym_op->auth.data.length = QUOTE_512_BYTES;\n+\n+\t/* Set crypto operation cipher parameters */\n+\tsym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC);\n+\n+\tTEST_ASSERT_NOT_NULL(sym_op->cipher.iv.data,\n+\t\t\t\"Failed to prepend place for iv input\");\n+\n+\tTEST_ASSERT_NOT_NULL(rte_pktmbuf_prepend(ut_params->obuf,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC),\n+\t\t\t\"Failed to prepend place for iv output\");\n+\n+\tsym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;\n+\n+\tsym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);\n+\tsym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;\n+\n+\trte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC);\n+\n+\tsym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;\n+\tsym_op->cipher.data.length = QUOTE_512_BYTES;\n+\n+\n+\t/* Process crypto operation */\n+\tTEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],\n+\t\t\tut_params->op), \"failed to process sym crypto op\");\n+\n+\tTEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,\n+\t\t\t\"crypto op processing failed\");\n+\n+\t/* Validate obuf */\n+\tuint8_t *ciphertext;\n+\n+\tciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst,\n+\t\t\tuint8_t *, CIPHER_IV_LENGTH_AES_CBC);\n+\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(ciphertext,\n+\t\t\tcatch_22_quote_2_512_bytes_AES_CBC_ciphertext,\n+\t\t\tQUOTE_512_BYTES,\n+\t\t\t\"ciphertext data not as expected\");\n+\n+\tuint8_t *digest = ciphertext + QUOTE_512_BYTES;\n+\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(digest,\n+\t\t\tcatch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest,\n+\t\t\tgbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD ?\n+\t\t\t\t\tTRUNCATED_DIGEST_BYTE_LENGTH_SHA1 :\n+\t\t\t\t\tDIGEST_BYTE_LENGTH_SHA1,\n+\t\t\t\"Generated digest data not as expected\");\n+\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+static int\n+test_AES_CBC_HMAC_SHA1_decrypt_digest_oop_ver(void)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tstruct crypto_unittest_params *ut_params = &unittest_params;\n+\n+\t/* Generate test mbuf data and digest */\n+\n+\tTEST_ASSERT_EQUAL(setup_oop_test_mbufs(&ut_params->ibuf,\n+\t\t\t&ut_params->obuf, ts_params->mbuf_pool,\n+\t\t\t(const char *)\n+\t\t\tcatch_22_quote_2_512_bytes_AES_CBC_ciphertext,\n+\t\t\tQUOTE_512_BYTES, 0), 0,\n+\t\t\t\"Allocation of rte_mbuf failed\");\n+\n+\tut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,\n+\t\t\tDIGEST_BYTE_LENGTH_SHA1);\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->digest,\t\"no room to append digest\");\n+\n+\trte_memcpy(ut_params->digest,\n+\t\t\tcatch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest,\n+\t\t\tDIGEST_BYTE_LENGTH_SHA1);\n+\n+\t/* Setup Cipher Parameters */\n+\tut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\tut_params->cipher_xform.next = NULL;\n+\n+\tut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;\n+\tut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT;\n+\tut_params->cipher_xform.cipher.key.data = aes_cbc_key;\n+\tut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;\n+\n+\t/* Setup HMAC Parameters */\n+\tut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;\n+\tut_params->auth_xform.next = &ut_params->cipher_xform;\n+\n+\tut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;\n+\tut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;\n+\tut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA1;\n+\tut_params->auth_xform.auth.key.data = hmac_sha1_key;\n+\tut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;\n+\n+\t/* Create Crypto session*/\n+\tut_params->sess =\n+\t\trte_cryptodev_sym_session_create(ts_params->valid_devs[0],\n+\t\t\t\t\t\t&ut_params->auth_xform);\n+\tTEST_ASSERT_NOT_NULL(ut_params->sess, \"Session creation failed\");\n+\n+\t/* Generate Crypto op data structure */\n+\tut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\tTEST_ASSERT_NOT_NULL(ut_params->op,\n+\t\t\t\"Failed to allocate symmetric crypto operation struct\");\n+\n+\t/* attach symmetric crypto session to crypto operations */\n+\trte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);\n+\n+\tstruct rte_crypto_sym_op *sym_op = ut_params->op->sym;\n+\n+\t/* set crypto operation source mbuf */\n+\tsym_op->m_src = ut_params->ibuf;\n+\tsym_op->m_dst = ut_params->obuf;\n+\n+\tsym_op->auth.digest.data = ut_params->digest;\n+\tsym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(\n+\t\t\tut_params->ibuf, QUOTE_512_BYTES);\n+\tsym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;\n+\n+\tsym_op->auth.data.length = QUOTE_512_BYTES;\n+\n+\tsym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC);\n+\n+\tTEST_ASSERT_NOT_NULL(sym_op->cipher.iv.data,\n+\t\t\t\"Failed to prepend place for iv input\");\n+\n+\tTEST_ASSERT_NOT_NULL(rte_pktmbuf_prepend(ut_params->obuf,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC),\n+\t\t\t\"Failed to prepend place for iv output\");\n+\n+\tsym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;\n+\n+\tsym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);\n+\tsym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;\n+\n+\trte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC);\n+\n+\tsym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;\n+\tsym_op->cipher.data.length = QUOTE_512_BYTES;\n+\n+\n+\t/* Process crypto operation */\n+\tTEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],\n+\t\t\tut_params->op), \"failed to process sym crypto op\");\n+\n+\tTEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,\n+\t\t\t\"Digest verification failed\");\n+\n+\tut_params->obuf = ut_params->op->sym->m_dst;\n+\n+\t/* Validate obuf */\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n+\t\t\trte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +\n+\t\t\tCIPHER_IV_LENGTH_AES_CBC,\n+\t\t\tcatch_22_quote,\n+\t\t\tQUOTE_512_BYTES,\n+\t\t\t\"Ciphertext data not as expected\");\n+\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n static int\n test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)\n {\n@@ -1900,6 +2150,46 @@ create_snow3g_cipher_operation(const uint8_t *iv, const unsigned iv_len,\n \treturn 0;\n }\n \n+static int\n+create_snow3g_cipher_operation_oop(const uint8_t *iv, const unsigned iv_len,\n+\t\t\tconst unsigned cipher_len,\n+\t\t\tconst unsigned cipher_offset)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tstruct crypto_unittest_params *ut_params = &unittest_params;\n+\tunsigned iv_pad_len = 0;\n+\n+\t/* Generate Crypto op data structure */\n+\tut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,\n+\t\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\tTEST_ASSERT_NOT_NULL(ut_params->op,\n+\t\t\t\t\"Failed to allocate pktmbuf offload\");\n+\n+\t/* Set crypto operation data parameters */\n+\trte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);\n+\n+\tstruct rte_crypto_sym_op *sym_op = ut_params->op->sym;\n+\n+\t/* set crypto operation source mbuf */\n+\tsym_op->m_src = ut_params->ibuf;\n+\tsym_op->m_dst = ut_params->obuf;\n+\n+\t/* iv */\n+\tiv_pad_len = RTE_ALIGN_CEIL(iv_len, 16);\n+\tsym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf\n+\t\t\t, iv_pad_len);\n+\n+\tTEST_ASSERT_NOT_NULL(sym_op->cipher.iv.data, \"no room to prepend iv\");\n+\n+\tmemset(sym_op->cipher.iv.data, 0, iv_pad_len);\n+\tsym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);\n+\tsym_op->cipher.iv.length = iv_pad_len;\n+\n+\trte_memcpy(sym_op->cipher.iv.data, iv, iv_len);\n+\tsym_op->cipher.data.length = cipher_len;\n+\tsym_op->cipher.data.offset = cipher_offset;\n+\treturn 0;\n+}\n \n static int\n create_snow3g_cipher_auth_session(uint8_t dev_id,\n@@ -2421,7 +2711,6 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n \n \tint retval;\n-\n \tuint8_t *plaintext, *ciphertext;\n \tuint8_t plaintext_pad_len;\n \tuint8_t lastByteValidBits = 8;\n@@ -2465,7 +2754,7 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)\n \t\t\t\t\t\tut_params->op);\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n \n-\tut_params->obuf = ut_params->op->sym->m_src;\n+\tut_params->obuf = ut_params->op->sym->m_dst;\n \tif (ut_params->obuf)\n \t\tciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n \t\t\t\t+ tdata->iv.len;\n@@ -2490,6 +2779,94 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)\n \treturn 0;\n }\n \n+\n+static int\n+test_snow3g_encryption_oop(const struct snow3g_test_data *tdata)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tstruct crypto_unittest_params *ut_params = &unittest_params;\n+\tuint8_t *plaintext, *ciphertext;\n+\n+\tint retval;\n+\tuint8_t plaintext_pad_len;\n+\tuint8_t lastByteValidBits = 8;\n+\tuint8_t lastByteMask = 0xFF;\n+\n+\t/* Create SNOW3G session */\n+\tretval = create_snow3g_cipher_session(ts_params->valid_devs[0],\n+\t\t\t\t\tRTE_CRYPTO_CIPHER_OP_ENCRYPT,\n+\t\t\t\t\ttdata->key.data, tdata->key.len);\n+\tif (retval < 0)\n+\t\treturn retval;\n+\n+\tut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);\n+\tut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->ibuf,\n+\t\t\t\"Failed to allocate input buffer in mempool\");\n+\tTEST_ASSERT_NOT_NULL(ut_params->obuf,\n+\t\t\t\"Failed to allocate output buffer in mempool\");\n+\n+\t/* Clear mbuf payload */\n+\tmemset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,\n+\t       rte_pktmbuf_tailroom(ut_params->ibuf));\n+\n+\t/*\n+\t * Append data which is padded to a\n+\t * multiple of the algorithms block size\n+\t */\n+\t/*tdata->plaintext.len = tdata->plaintext.len >> 3;*/\n+\tplaintext_pad_len = RTE_ALIGN_CEIL((tdata->plaintext.len >> 3), 16);\n+\n+\tplaintext = (uint8_t *) rte_pktmbuf_append(ut_params->ibuf,\n+\t\t\t\t\t\tplaintext_pad_len);\n+\n+\trte_pktmbuf_append(ut_params->obuf,\n+\t\t\t\t\t\tplaintext_pad_len);\n+\n+\tmemcpy(plaintext, tdata->plaintext.data, (tdata->plaintext.len >> 3));\n+\n+#ifdef RTE_APP_TEST_DEBUG\n+\trte_hexdump(stdout, \"plaintext:\", plaintext, tdata->plaintext.len);\n+#endif\n+\t/* Create SNOW3G operation */\n+\tretval = create_snow3g_cipher_operation_oop(tdata->iv.data,\n+\t\t\t\t\ttdata->iv.len,\n+\t\t\t\t\ttdata->validCipherLenInBits.len,\n+\t\t\t\t\ttdata->validCipherOffsetLenInBits.len);\n+\tif (retval < 0)\n+\t\treturn retval;\n+\n+\tut_params->op = process_crypto_request(ts_params->valid_devs[0],\n+\t\t\t\t\t\tut_params->op);\n+\tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n+\n+\tut_params->obuf = ut_params->op->sym->m_dst;\n+\tif (ut_params->obuf)\n+\t\tciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n+\t\t\t\t+ tdata->iv.len;\n+\telse\n+\t\tciphertext = plaintext;\n+\n+\tlastByteValidBits = (tdata->validDataLenInBits.len % 8);\n+\tif (lastByteValidBits == 0)\n+\t\tlastByteValidBits = 8;\n+\tlastByteMask = lastByteMask << (8 - lastByteValidBits);\n+\t(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;\n+\n+#ifdef RTE_APP_TEST_DEBUG\n+\trte_hexdump(stdout, \"ciphertext:\", ciphertext, tdata->ciphertext.len);\n+#endif\n+\t/* Validate obuf */\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n+\t\tciphertext,\n+\t\ttdata->ciphertext.data,\n+\t\ttdata->ciphertext.len >> 3,\n+\t\t\"Snow3G Ciphertext data not as expected\");\n+\treturn 0;\n+}\n+\n+\n static int test_snow3g_decryption(const struct snow3g_test_data *tdata)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n@@ -2561,6 +2938,91 @@ static int test_snow3g_decryption(const struct snow3g_test_data *tdata)\n \treturn 0;\n }\n \n+static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tstruct crypto_unittest_params *ut_params = &unittest_params;\n+\n+\tint retval;\n+\n+\tuint8_t *plaintext, *ciphertext;\n+\tuint8_t ciphertext_pad_len;\n+\tuint8_t lastByteValidBits = 8;\n+\tuint8_t lastByteMask = 0xFF;\n+\n+\t/* Create SNOW3G session */\n+\tretval = create_snow3g_cipher_session(ts_params->valid_devs[0],\n+\t\t\t\t\tRTE_CRYPTO_CIPHER_OP_DECRYPT,\n+\t\t\t\t\ttdata->key.data, tdata->key.len);\n+\tif (retval < 0)\n+\t\treturn retval;\n+\n+\tut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);\n+\tut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);\n+\n+\tTEST_ASSERT_NOT_NULL(ut_params->ibuf,\n+\t\t\t\"Failed to allocate input buffer\");\n+\tTEST_ASSERT_NOT_NULL(ut_params->obuf,\n+\t\t\t\"Failed to allocate output buffer\");\n+\n+\t/* Clear mbuf payload */\n+\tmemset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,\n+\t       rte_pktmbuf_tailroom(ut_params->ibuf));\n+\n+\tmemset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,\n+\t\t       rte_pktmbuf_tailroom(ut_params->obuf));\n+\n+\t/*\n+\t * Append data which is padded to a\n+\t * multiple of the algorithms block size\n+\t */\n+\tciphertext_pad_len = RTE_ALIGN_CEIL((tdata->ciphertext.len >> 3), 16);\n+\n+\tciphertext = (uint8_t *) rte_pktmbuf_append(ut_params->ibuf,\n+\t\t\t\t\t\tciphertext_pad_len);\n+\n+\trte_pktmbuf_append(ut_params->obuf,\n+\t\t\t\t\t\tciphertext_pad_len);\n+\n+\tmemcpy(ciphertext, tdata->ciphertext.data, tdata->ciphertext.len >> 3);\n+\n+#ifdef RTE_APP_TEST_DEBUG\n+\trte_hexdump(stdout, \"ciphertext:\", ciphertext, tdata->ciphertext.len);\n+#endif\n+\t/* Create SNOW3G operation */\n+\tretval = create_snow3g_cipher_operation_oop(tdata->iv.data,\n+\t\t\t\t\ttdata->iv.len,\n+\t\t\t\t\ttdata->validCipherLenInBits.len,\n+\t\t\t\t\ttdata->validCipherOffsetLenInBits.len);\n+\tif (retval < 0)\n+\t\treturn retval;\n+\n+\tut_params->op = process_crypto_request(ts_params->valid_devs[0],\n+\t\t\t\t\t\tut_params->op);\n+\tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n+\tut_params->obuf = ut_params->op->sym->m_dst;\n+\tif (ut_params->obuf)\n+\t\tplaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n+\t\t\t\t+ tdata->iv.len;\n+\telse\n+\t\tplaintext = ciphertext;\n+\tlastByteValidBits = (tdata->validDataLenInBits.len  % 8);\n+\tif (lastByteValidBits == 0)\n+\t\tlastByteValidBits = 8;\n+\tlastByteMask = lastByteMask << (8 - lastByteValidBits);\n+\t(*(plaintext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;\n+\n+#ifdef RTE_APP_TEST_DEBUG\n+\trte_hexdump(stdout, \"plaintext:\", plaintext, tdata->plaintext.len);\n+#endif\n+\t/* Validate obuf */\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(plaintext,\n+\t\t\t\ttdata->plaintext.data,\n+\t\t\t\ttdata->plaintext.len >> 3,\n+\t\t\t\t\"Snow3G Plaintext data not as expected\");\n+\treturn 0;\n+}\n+\n static int\n test_snow3g_authenticated_encryption(const struct snow3g_test_data *tdata)\n {\n@@ -2747,6 +3209,12 @@ test_snow3g_encryption_test_case_1(void)\n }\n \n static int\n+test_snow3g_encryption_test_case_1_oop(void)\n+{\n+\treturn test_snow3g_encryption_oop(&snow3g_test_case_1);\n+}\n+\n+static int\n test_snow3g_encryption_test_case_2(void)\n {\n \treturn test_snow3g_encryption(&snow3g_test_case_2);\n@@ -2777,6 +3245,12 @@ test_snow3g_decryption_test_case_1(void)\n }\n \n static int\n+test_snow3g_decryption_test_case_1_oop(void)\n+{\n+\treturn test_snow3g_decryption_oop(&snow3g_test_case_1);\n+}\n+\n+static int\n test_snow3g_decryption_test_case_2(void)\n {\n \treturn test_snow3g_decryption(&snow3g_test_case_2);\n@@ -3769,6 +4243,9 @@ test_null_burst_operation(void)\n \treturn TEST_SUCCESS;\n }\n \n+\n+\n+\n static struct unit_test_suite cryptodev_qat_testsuite  = {\n \t.suite_name = \"Crypto QAT Unit Test Suite\",\n \t.setup = testsuite_setup,\n@@ -3784,6 +4261,11 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {\n \t\t\t\ttest_multi_session),\n \n \t\tTEST_CASE_ST(ut_setup, ut_teardown,\n+\t\t\t\ttest_AES_CBC_HMAC_SHA1_encrypt_digest_oop),\n+\t\tTEST_CASE_ST(ut_setup, ut_teardown,\n+\t\t\t\ttest_AES_CBC_HMAC_SHA1_decrypt_digest_oop_ver),\n+\n+\t\tTEST_CASE_ST(ut_setup, ut_teardown,\n \t\t\t\ttest_AES_CBC_HMAC_SHA1_encrypt_digest),\n \t\tTEST_CASE_ST(ut_setup, ut_teardown,\n \t\t\t\ttest_AES_CBC_HMAC_SHA1_decrypt_digest_verify),\n@@ -3848,6 +4330,11 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {\n \t\tTEST_CASE_ST(ut_setup, ut_teardown,\n \t\t\ttest_snow3g_encryption_test_case_5),\n \n+\t\tTEST_CASE_ST(ut_setup, ut_teardown,\n+\t\t\ttest_snow3g_encryption_test_case_1_oop),\n+\t\tTEST_CASE_ST(ut_setup, ut_teardown,\n+\t\t\ttest_snow3g_decryption_test_case_1_oop),\n+\n \t\t/** Snow3G decrypt only (UEA2) */\n \t\tTEST_CASE_ST(ut_setup, ut_teardown,\n \t\t\ttest_snow3g_decryption_test_case_1),\n",
    "prefixes": [
        "dpdk-dev",
        "2/2"
    ]
}