get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121683,
    "url": "https://patches.dpdk.org/api/patches/121683/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230106161536.68058-1-ciara.power@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20230106161536.68058-1-ciara.power@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230106161536.68058-1-ciara.power@intel.com",
    "date": "2023-01-06T16:15:36",
    "name": "test/crypto: fix and improve ZUC cipher and auth tests",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "74d8e27b32d0f2adbfecf75e7d7ca0eaa1e2f4bd",
    "submitter": {
        "id": 978,
        "url": "https://patches.dpdk.org/api/people/978/?format=api",
        "name": "Power, Ciara",
        "email": "ciara.power@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230106161536.68058-1-ciara.power@intel.com/mbox/",
    "series": [
        {
            "id": 26418,
            "url": "https://patches.dpdk.org/api/series/26418/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26418",
            "date": "2023-01-06T16:15:36",
            "name": "test/crypto: fix and improve ZUC cipher and auth tests",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/26418/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/121683/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/121683/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DB47CA00C2;\n\tFri,  6 Jan 2023 17:15:44 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8367A40141;\n\tFri,  6 Jan 2023 17:15:44 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id BE9DB400EF\n for <dev@dpdk.org>; Fri,  6 Jan 2023 17:15:42 +0100 (CET)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jan 2023 08:15:41 -0800",
            "from silpixa00400355.ir.intel.com (HELO\n silpixa00400355.ger.corp.intel.com) ([10.237.222.219])\n by fmsmga005.fm.intel.com with ESMTP; 06 Jan 2023 08:15:39 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1673021743; x=1704557743;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=mmLqcb9x39XwBDFv0CHAQqZ/EaL4biOn895mJuH/vYg=;\n b=UE5j6ftZRzdkOdRRm1+oA2VGMAOZpbWD3GV6vqmpZXdwt4OpLIJ+5UVh\n e2UpjjnMlvFOKLpX3ovF0hauieV90+wgo6f/29/iwedxmD9xtRGFN49W/\n hp/yl6WzZl2jIqe30rVMztOblCIgMvjHttejRBNXZrX461iqRUtcAlzFH\n T8mu5FUvooFBYLdQIPfvWCXe0bBhHb2IN/E3AB0gUf1QhPjNyIjq8hRcN\n W5Odz5vbirO3Lkqw0b97xp7/8vY/R4BI8GT3a2T7QfaOdZpmXPlIR0ybS\n K/Q9xKAOLHN9kfvi351xi75GYDYJG8Xy+hQ2UYDFSdMbic4+uj9z2Kxux g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10582\"; a=\"321207930\"",
            "E=Sophos;i=\"5.96,305,1665471600\"; d=\"scan'208\";a=\"321207930\"",
            "E=McAfee;i=\"6500,9779,10582\"; a=\"984705591\"",
            "E=Sophos;i=\"5.96,305,1665471600\"; d=\"scan'208\";a=\"984705591\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Power <ciara.power@intel.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>,\n Tejasree Kondoj <ktejasree@marvell.com>,\n Ciara Power <ciara.power@intel.com>",
        "Cc": "dev@dpdk.org,\n\tkai.ji@intel.com",
        "Subject": "[PATCH] test/crypto: fix and improve ZUC cipher and auth tests",
        "Date": "Fri,  6 Jan 2023 16:15:36 +0000",
        "Message-Id": "<20230106161536.68058-1-ciara.power@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "The incorrect value was used for the reference plaintext offset\nin ZUC cipher function. This is now fixed to convert to byte length,\nrather than bits.\n\nAlso, to cleanup the ZUC test code, some small improvements are made.\nThe authentication function takes the auth op enum as a parameter\ninstead of a new variable, this can then be used directly.\nThe cipher SGL function does not need to buffers allocated for\nciphertext and plaintext, one can be used for both.\n\nFixes: be8e5d957366 (\"test/crypto: add further ZUC testcases\")\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n---\n app/test/test_cryptodev.c | 92 +++++++++++++++++++++++----------------\n 1 file changed, 55 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex a824ed3511..aa831d79a2 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -6059,7 +6059,7 @@ test_zuc_cipher(const struct wireless_test_data *tdata,\n \t\tdebug_hexdump(stdout, \"plaintext:\", plaintext, ciphertext_len);\n \n \t\tconst uint8_t *reference_plaintext = tdata->plaintext.data +\n-\t\t\t\t(tdata->validCipherOffsetInBits.len);\n+\t\t\t\t(tdata->validCipherOffsetInBits.len >> 3);\n \n \t\t/* Validate obuf */\n \t\tTEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(\n@@ -6085,7 +6085,7 @@ test_zuc_cipher_sgl(const struct wireless_test_data *tdata,\n \tunsigned int plaintext_len = 0;\n \tunsigned int ciphertext_len = 0;\n \tconst uint8_t *ciphertext, *plaintext;\n-\tuint8_t ciphertext_buffer[2048], plaintext_buffer[2048];\n+\tuint8_t buffer[2048];\n \tstruct rte_cryptodev_info dev_info;\n \n \t/* Check if device supports ZUC EEA3 */\n@@ -6174,10 +6174,10 @@ test_zuc_cipher_sgl(const struct wireless_test_data *tdata,\n \tif (direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT) {\n \t\tif (ut_params->obuf)\n \t\t\tciphertext = rte_pktmbuf_read(ut_params->obuf,\n-\t\t\t\t0, plaintext_len, ciphertext_buffer);\n+\t\t\t\t0, plaintext_len, buffer);\n \t\telse\n \t\t\tciphertext = rte_pktmbuf_read(ut_params->ibuf,\n-\t\t\t\t0, plaintext_len, ciphertext_buffer);\n+\t\t\t\t0, plaintext_len, buffer);\n \n \t\t/* Validate obuf */\n \t\tdebug_hexdump(stdout, \"ciphertext:\", ciphertext, plaintext_len);\n@@ -6191,10 +6191,10 @@ test_zuc_cipher_sgl(const struct wireless_test_data *tdata,\n \t} else {\n \t\tif (ut_params->obuf)\n \t\t\tplaintext = rte_pktmbuf_read(ut_params->obuf,\n-\t\t\t\t0, ciphertext_len, plaintext_buffer);\n+\t\t\t\t0, ciphertext_len, buffer);\n \t\telse\n \t\t\tplaintext = rte_pktmbuf_read(ut_params->ibuf,\n-\t\t\t\t0, ciphertext_len, plaintext_buffer);\n+\t\t\t\t0, ciphertext_len, buffer);\n \n \t\t/* Validate obuf */\n \t\tdebug_hexdump(stdout, \"plaintext:\", plaintext, ciphertext_len);\n@@ -6211,7 +6211,8 @@ test_zuc_cipher_sgl(const struct wireless_test_data *tdata,\n }\n \n static int\n-test_zuc_authentication(const struct wireless_test_data *tdata, uint8_t verify)\n+test_zuc_authentication(const struct wireless_test_data *tdata,\n+\t\tenum rte_crypto_auth_operation auth_op)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n@@ -6251,9 +6252,7 @@ test_zuc_authentication(const struct wireless_test_data *tdata, uint8_t verify)\n \tretval = create_wireless_algo_hash_session(ts_params->valid_devs[0],\n \t\t\ttdata->key.data, tdata->key.len,\n \t\t\ttdata->auth_iv.len, tdata->digest.len,\n-\t\t\t(verify ? RTE_CRYPTO_AUTH_OP_VERIFY\n-\t\t\t\t\t: RTE_CRYPTO_AUTH_OP_GENERATE),\n-\t\t\tRTE_CRYPTO_AUTH_ZUC_EIA3);\n+\t\t\tauth_op, RTE_CRYPTO_AUTH_ZUC_EIA3);\n \tif (retval != 0)\n \t\treturn retval;\n \n@@ -6276,10 +6275,7 @@ test_zuc_authentication(const struct wireless_test_data *tdata, uint8_t verify)\n \t\t\ttdata->digest.len,\n \t\t\ttdata->auth_iv.data, tdata->auth_iv.len,\n \t\t\tplaintext_pad_len,\n-\t\t\t(verify ? RTE_CRYPTO_AUTH_OP_VERIFY\n-\t\t\t\t\t: RTE_CRYPTO_AUTH_OP_GENERATE),\n-\t\t\ttdata->validAuthLenInBits.len,\n-\t\t\t0);\n+\t\t\tauth_op, tdata->validAuthLenInBits.len, 0);\n \tif (retval < 0)\n \t\treturn retval;\n \n@@ -6294,7 +6290,7 @@ test_zuc_authentication(const struct wireless_test_data *tdata, uint8_t verify)\n \tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n \t\t\t+ plaintext_pad_len;\n \n-\tif (!verify) {\n+\tif (auth_op != RTE_CRYPTO_AUTH_OP_VERIFY) {\n \t\t/* Validate obuf */\n \t\tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n \t\t\t\tut_params->digest,\n@@ -7336,133 +7332,155 @@ test_zuc_decryption_test_case_6_sgl(void)\n static int\n test_zuc_hash_generate_test_case_1(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_1b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_1b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_2(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_90b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_90b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_3(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_577b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_577b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_4(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_2079b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_2079b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_5(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_auth_5670b, 0);\n+\treturn test_zuc_authentication(&zuc_test_auth_5670b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_6(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_128b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_128b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_7(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_2080b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_2080b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_8(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_584b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_584b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_9(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_10(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_generate_test_case_11(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b, 0);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_GENERATE);\n }\n \n static int\n test_zuc_hash_verify_test_case_1(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_1b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_1b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_2(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_90b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_90b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_3(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_577b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_577b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_4(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_2079b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_2079b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_5(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_auth_5670b, 1);\n+\treturn test_zuc_authentication(&zuc_test_auth_5670b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_6(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_128b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_128b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_7(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_2080b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_2080b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_8(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_584b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_584b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_9(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_32b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_10(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_64b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n test_zuc_hash_verify_test_case_11(void)\n {\n-\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b, 1);\n+\treturn test_zuc_authentication(&zuc_test_case_auth_4000b_mac_128b,\n+\t\t\tRTE_CRYPTO_AUTH_OP_VERIFY);\n }\n \n static int\n",
    "prefixes": []
}