get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133898,
    "url": "http://patchwork.dpdk.org/api/patches/133898/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231103133037.782512-2-venkatx.sivaramakrishnan@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20231103133037.782512-2-venkatx.sivaramakrishnan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231103133037.782512-2-venkatx.sivaramakrishnan@intel.com",
    "date": "2023-11-03T13:30:37",
    "name": "[2/2] test/crypto: add negative test cases for cipher buffer alignment",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "40878636fede1d6cd1bd6e1f5a9942838eec7b3b",
    "submitter": {
        "id": 3155,
        "url": "http://patchwork.dpdk.org/api/people/3155/?format=api",
        "name": "Sivaramakrishnan Venkat",
        "email": "venkatx.sivaramakrishnan@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patchwork.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231103133037.782512-2-venkatx.sivaramakrishnan@intel.com/mbox/",
    "series": [
        {
            "id": 30170,
            "url": "http://patchwork.dpdk.org/api/series/30170/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30170",
            "date": "2023-11-03T13:30:36",
            "name": "[1/2] crypto/qat: fix block cipher misalignment for AES CBC and 3DES CBC",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/30170/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/133898/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/133898/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 12B1F432B0;\n\tMon,  6 Nov 2023 15:18:20 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E49DF406B8;\n\tMon,  6 Nov 2023 15:18:15 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 1088F40273;\n Fri,  3 Nov 2023 14:30:49 +0100 (CET)",
            "from orviesa001.jf.intel.com ([10.64.159.141])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Nov 2023 06:30:49 -0700",
            "from silpixa00401012.ir.intel.com ([10.243.22.112])\n by orviesa001.jf.intel.com with ESMTP; 03 Nov 2023 06:30:48 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1699018250; x=1730554250;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=dwJxZlZhhy7hIvbzQJnf9sRdlbnvOB79bIwuehFZfZQ=;\n b=Vsx9IqS9Yu0sr+/2X+X9hBKK9D9sWmP7IAkuI4jfvxXd0wJjpWSqacw3\n BtbHbcUfggBvV2dBR2dZ5veMd3GxMrnH3COuibLFI+QoIOaFp2KHKrABO\n n4GS1UUbn2ue3VlaMfPTWOfrV2ehSSicPG+kw5ZfE/QTSEl4hg1+iz8zO\n ctk9V80c0yi6K522KdXlQnMzDFCCQlOwZFouMEwR26DWDTP33Ae/b9u/w\n 5cau3/E8iAn7I7llIse9le7sIljzI2PbCgrR6rMkkWZqKM2GvYUD9nKrr\n I3npZgZi74J1F8TeUx455zeRWnPS5THqCDzlNq+VpdOR2z2ihUn1rfDc1 w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10883\"; a=\"388770147\"",
            "E=Sophos;i=\"6.03,273,1694761200\"; d=\"scan'208\";a=\"388770147\"",
            "E=Sophos;i=\"6.03,273,1694761200\";\n   d=\"scan'208\";a=\"9378774\""
        ],
        "X-ExtLoop1": "1",
        "From": "Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>,\n\tFan Zhang <fanzhang.oss@gmail.com>",
        "Cc": "dev@dpdk.org, stable@dpdk.org,\n Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>",
        "Subject": "[PATCH 2/2] test/crypto: add negative test cases for cipher buffer\n alignment",
        "Date": "Fri,  3 Nov 2023 13:30:37 +0000",
        "Message-Id": "<20231103133037.782512-2-venkatx.sivaramakrishnan@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231103133037.782512-1-venkatx.sivaramakrishnan@intel.com>",
        "References": "<20231103133037.782512-1-venkatx.sivaramakrishnan@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 06 Nov 2023 15:18:13 +0100",
        "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": "add negative test cases for 3DES CBC and AES CBC\ncipher algorithms for buffer misalignment\n\nSigned-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>\n---\n app/test/test_cryptodev.c                  | 321 ++++++++++++++++++++-\n app/test/test_cryptodev_aes_test_vectors.h | 119 ++++++++\n app/test/test_cryptodev_blockcipher.c      |  20 +-\n app/test/test_cryptodev_blockcipher.h      |   1 +\n app/test/test_cryptodev_des_test_vectors.h |  38 +++\n 5 files changed, 491 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex d2c4c6f8b5..12e0cf8044 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -1371,6 +1371,42 @@ negative_hmac_sha1_testsuite_setup(void)\n \treturn 0;\n }\n \n+static int\n+negative_input_buffer_misalignment_testsuite_setup(void)\n+{\n+\tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tuint8_t dev_id = ts_params->valid_devs[0];\n+\tstruct rte_cryptodev_info dev_info;\n+\tconst enum rte_crypto_cipher_algorithm ciphers[] = {\n+\t\tRTE_CRYPTO_CIPHER_3DES_CBC,\n+\t\tRTE_CRYPTO_CIPHER_AES_CBC\n+\t};\n+\tconst enum rte_crypto_auth_algorithm auths[] = {\n+\t\tRTE_CRYPTO_AUTH_SHA256,\n+\t\tRTE_CRYPTO_AUTH_SHA256,\n+\t};\n+\n+\trte_cryptodev_info_get(dev_id, &dev_info);\n+\n+\tif (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) ||\n+\t\t\t((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&\n+\t\t\t!(dev_info.feature_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {\n+\t\tRTE_LOG(INFO, USER1, \"Feature flag requirements for Negative \"\n+\t\t\t\t\"Input Buffer misalignment testsuite not met\\n\");\n+\t\treturn TEST_SKIPPED;\n+\t}\n+\n+\tif (check_cipher_capabilities_supported(ciphers, RTE_DIM(ciphers)) != 0\n+\t\t\t&& check_auth_capabilities_supported(auths,\n+\t\t\tRTE_DIM(auths)) != 0) {\n+\t\tRTE_LOG(INFO, USER1, \"Capability requirements for Negative \"\n+\t\t\t\t\"Input Buffer misalignment testsuite not met\\n\");\n+\t\treturn TEST_SKIPPED;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n dev_configure_and_start(uint64_t ff_disable)\n {\n@@ -14469,6 +14505,192 @@ aes128cbc_hmac_sha1_test_vector = {\n \t}\n };\n \n+static const struct test_crypto_vector\n+aes128cbc_sha256_misalign_test_vector = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_offset = 0,\n+\t.cipher_len = 511,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_aes_common,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes128cbc,\n+\t\t.len = 511\n+\t},\n+\t.auth_algo = RTE_CRYPTO_AUTH_SHA256,\n+\t.auth_offset = 0,\n+\t.auth_key = {\n+\t\t.data = {\n+\t\t\t0x42, 0x1A, 0x7D, 0x3D, 0xF5, 0x82, 0x80, 0xF1,\n+\t\t\t0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,\n+\t\t\t0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,\n+\t\t\t0x9A, 0x4F, 0x88, 0x1B, 0xB6, 0x8F, 0xD8, 0x60\n+\t\t},\n+\t\t.len = 32\n+\t},\n+\t.digest = {\n+\t\t.data = {\n+\t\t\t0xA8, 0xBC, 0xDB, 0x99, 0xAA, 0x45, 0x91, 0xA3,\n+\t\t\t0x2D, 0x75, 0x41, 0x92, 0x28, 0x01, 0x87, 0x5D,\n+\t\t\t0x45, 0xED, 0x49, 0x05, 0xD3, 0xAE, 0x32, 0x57,\n+\t\t\t0xB7, 0x79, 0x65, 0xFC, 0xFA, 0x6C, 0xFA, 0xDF\n+\t\t},\n+\t\t.len = 32\n+\t}\n+};\n+\n+static const struct test_crypto_vector\n+aes192cbc_sha256_misalign_test_vector = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_offset = 0,\n+\t.cipher_len = 511,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A,\n+\t\t\t0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0\n+\t\t},\n+\t\t.len = 24\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_hash,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes192cbc,\n+\t\t.len = 511\n+\t},\n+\t.auth_algo = RTE_CRYPTO_AUTH_SHA256,\n+\t.auth_offset = 0,\n+\t.auth_key = {\n+\t\t.data = {\n+\t\t\t0x42, 0x1A, 0x7D, 0x3D, 0xF5, 0x82, 0x80, 0xF1,\n+\t\t\t0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,\n+\t\t\t0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,\n+\t\t\t0x9A, 0x4F, 0x88, 0x1B, 0xB6, 0x8F, 0xD8, 0x60\n+\t\t},\n+\t\t.len = 32\n+\t},\n+\t.digest = {\n+\t\t.data = {\n+\t\t\t0xE0, 0x4E, 0x39, 0x67, 0xB8, 0xB4, 0x56, 0xF4,\n+\t\t\t0x03, 0x0C, 0xF5, 0x74, 0x52, 0xFF, 0x63, 0x48,\n+\t\t\t0xE0, 0x3C, 0x38, 0x49, 0x76, 0x29, 0xC0, 0x57,\n+\t\t\t0xF4, 0x4A, 0x3E, 0x4F, 0x88, 0xB5, 0x05, 0x0E\n+\t\t},\n+\t\t.len = 32\n+\t}\n+};\n+\n+static const struct test_crypto_vector\n+aes256cbc_sha256_misalign_test_vector = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_offset = 0,\n+\t.cipher_len = 511,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A,\n+\t\t\t0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0,\n+\t\t\t0x37, 0x07, 0xB8, 0x23, 0xA2, 0xA3, 0xB5, 0x8D\n+\t\t},\n+\t\t.len = 32\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_hash,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes256cbc,\n+\t\t.len = 511\n+\t},\n+\t.auth_algo = RTE_CRYPTO_AUTH_SHA256,\n+\t.auth_offset = 0,\n+\t.auth_key = {\n+\t\t.data = {\n+\t\t\t0x42, 0x1A, 0x7D, 0x3D, 0xF5, 0x82, 0x80, 0xF1,\n+\t\t\t0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,\n+\t\t\t0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,\n+\t\t\t0x9A, 0x4F, 0x88, 0x1B, 0xB6, 0x8F, 0xD8, 0x60\n+\t\t},\n+\t\t.len = 32\n+\t},\n+\t.digest = {\n+\t\t.data = {\n+\t\t\t0x29, 0x1A, 0x38, 0x7E, 0xBC, 0x57, 0xC4, 0xB6,\n+\t\t\t0xD6, 0xCE, 0xEF, 0x96, 0x5D, 0x76, 0x2F, 0x3C,\n+\t\t\t0xDA, 0x95, 0x51, 0x82, 0xD7, 0x7B, 0x11, 0x92,\n+\t\t\t0x85, 0xED, 0x2D, 0xB5, 0xCF, 0x03, 0xF4, 0x54\n+\t\t},\n+\t\t.len = 32\n+\t}\n+};\n+\n+static const struct test_crypto_vector\n+triple_des128cbc_sha1_misalign_test_vector = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_3DES_CBC,\n+\t.cipher_len = 511,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n+\t\t},\n+\t\t.len = 8\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_hash,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_des128cbc,\n+\t\t.len = 511\n+\t},\n+\t.auth_algo = RTE_CRYPTO_AUTH_SHA1,\n+\t.digest = {\n+\t\t.data = {\n+\t\t\t0x94, 0x45, 0x7B, 0xDF, 0xFE, 0x80, 0xB9, 0xA6,\n+\t\t\t0xA0, 0x7A, 0xE8, 0x93, 0x40, 0x7B, 0x85, 0x02,\n+\t\t\t0x1C, 0xD7, 0xE8, 0x87\n+\t\t},\n+\t\t.len = 20\n+\t}\n+};\n+\n static const struct test_crypto_vector\n aes128cbc_hmac_sha1_aad_test_vector = {\n \t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n@@ -15058,7 +15280,7 @@ test_authenticated_decryption_fail_when_corruption(\n }\n \n static int\n-test_authenticated_encrypt_with_esn(\n+test_authenticated_encrypt(\n \t\tstruct crypto_testsuite_params *ts_params,\n \t\tstruct crypto_unittest_params *ut_params,\n \t\tconst struct test_crypto_vector *reference)\n@@ -15159,7 +15381,7 @@ test_authenticated_encrypt_with_esn(\n \t\tut_params->op = process_crypto_request(\n \t\t\tts_params->valid_devs[0], ut_params->op);\n \n-\tTEST_ASSERT_NOT_NULL(ut_params->op, \"no crypto operation returned\");\n+\tTEST_ASSERT_NOT_NULL(ut_params->op, \"Failed crypto process, no operation returned\");\n \n \tTEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,\n \t\t\t\"crypto op processing failed\");\n@@ -15191,7 +15413,7 @@ test_authenticated_encrypt_with_esn(\n }\n \n static int\n-test_authenticated_decrypt_with_esn(\n+test_authenticated_decrypt(\n \t\tstruct crypto_testsuite_params *ts_params,\n \t\tstruct crypto_unittest_params *ut_params,\n \t\tconst struct test_crypto_vector *reference)\n@@ -15291,7 +15513,7 @@ test_authenticated_decrypt_with_esn(\n \t\tut_params->op = process_crypto_request(ts_params->valid_devs[0],\n \t\t\tut_params->op);\n \n-\tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed crypto process\");\n+\tTEST_ASSERT_NOT_NULL(ut_params->op, \"Failed crypto process, no operation returned\");\n \tTEST_ASSERT_EQUAL(ut_params->op->status,\n \t\t\tRTE_CRYPTO_OP_STATUS_SUCCESS,\n \t\t\t\"crypto op processing passed\");\n@@ -15850,7 +16072,7 @@ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt(void)\n static int\n auth_encrypt_AES128CBC_HMAC_SHA1_esn_check(void)\n {\n-\treturn test_authenticated_encrypt_with_esn(\n+\treturn test_authenticated_encrypt(\n \t\t\t&testsuite_params,\n \t\t\t&unittest_params,\n \t\t\t&aes128cbc_hmac_sha1_aad_test_vector);\n@@ -15859,12 +16081,48 @@ auth_encrypt_AES128CBC_HMAC_SHA1_esn_check(void)\n static int\n auth_decrypt_AES128CBC_HMAC_SHA1_esn_check(void)\n {\n-\treturn test_authenticated_decrypt_with_esn(\n+\treturn test_authenticated_decrypt(\n \t\t\t&testsuite_params,\n \t\t\t&unittest_params,\n \t\t\t&aes128cbc_hmac_sha1_aad_test_vector);\n }\n \n+static int\n+test_cipher_auth_encryption_fail_data_misalignment(const void *test_data)\n+{\n+\tstruct test_crypto_vector test_vector;\n+\tint res;\n+\n+\tmemcpy(&test_vector, test_data, sizeof(test_vector));\n+\tRTE_LOG(INFO, USER1, \"This is a negative test, errors are expected\\n\");\n+\tres = test_authenticated_encrypt(\n+\t\t\t&testsuite_params,\n+\t\t\t&unittest_params,\n+\t\t\t&test_vector);\n+\tif (res == TEST_SKIPPED)\n+\t\treturn res;\n+\tTEST_ASSERT_EQUAL(res, TEST_FAILED, \"encryption not failed\");\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_cipher_auth_decryption_fail_data_misalignment(const void *test_data)\n+{\n+\tstruct test_crypto_vector test_vector;\n+\tint res;\n+\n+\tmemcpy(&test_vector, test_data, sizeof(test_vector));\n+\tRTE_LOG(INFO, USER1, \"This is a negative test, errors are expected\\n\");\n+\tres = test_authenticated_decrypt(\n+\t\t\t&testsuite_params,\n+\t\t\t&unittest_params,\n+\t\t\t&test_vector);\n+\tif (res == TEST_SKIPPED)\n+\t\treturn res;\n+\tTEST_ASSERT_EQUAL(res, TEST_FAILED, \"decryption not failed\");\n+\treturn TEST_SUCCESS;\n+}\n+\n static int\n test_chacha20_poly1305_encrypt_test_case_rfc8439(void)\n {\n@@ -16675,6 +16933,56 @@ static struct unit_test_suite cryptodev_negative_hmac_sha1_testsuite = {\n \t}\n };\n \n+static struct unit_test_suite cryptodev_negative_input_buffer_misalignment_testsuite = {\n+\t.suite_name = \"Negative Input buffer misalignment Unit Test Suite\",\n+\t.setup = negative_input_buffer_misalignment_testsuite_setup,\n+\t.unit_test_cases = {\n+\t\t/** Negative tests */\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"3DES128 CBC SHA1 auth encryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_encryption_fail_data_misalignment,\n+\t\t\t&triple_des128cbc_sha1_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"3DES128 CBC SHA1 auth decryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_decryption_fail_data_misalignment,\n+\t\t\t&triple_des128cbc_sha1_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES128 CBC SHA256 auth encryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_encryption_fail_data_misalignment,\n+\t\t\t&aes128cbc_sha256_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES128 CBC SHA256 auth decryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_decryption_fail_data_misalignment,\n+\t\t\t&aes128cbc_sha256_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES192 CBC SHA256 auth encryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_encryption_fail_data_misalignment,\n+\t\t\t&aes192cbc_sha256_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES192 CBC SHA256 auth decryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_decryption_fail_data_misalignment,\n+\t\t\t&aes192cbc_sha256_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES256 CBC SHA256 auth encryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_encryption_fail_data_misalignment,\n+\t\t\t&aes256cbc_sha256_misalign_test_vector),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\n+\t\t\t\"AES256 CBC SHA256 auth decryption negative test for data misalignment\",\n+\t\t\tut_setup, ut_teardown,\n+\t\t\ttest_cipher_auth_decryption_fail_data_misalignment,\n+\t\t\t&aes256cbc_sha256_misalign_test_vector),\n+\n+\t\tTEST_CASES_END() /**< NULL terminate unit test array */\n+\t}\n+};\n+\n static struct unit_test_suite cryptodev_multi_session_testsuite = {\n \t.suite_name = \"Multi Session Unit Test Suite\",\n \t.setup = multi_session_testsuite_setup,\n@@ -17567,6 +17875,7 @@ run_cryptodev_testsuite(const char *pmd_name)\n \t\t&cryptodev_esn_testsuite,\n \t\t&cryptodev_negative_aes_gcm_testsuite,\n \t\t&cryptodev_negative_aes_gmac_testsuite,\n+\t\t&cryptodev_negative_input_buffer_misalignment_testsuite,\n \t\t&cryptodev_mixed_cipher_hash_testsuite,\n \t\t&cryptodev_negative_hmac_sha1_testsuite,\n \t\t&cryptodev_gen_testsuite,\ndiff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h\nindex 7127156cc4..a026c2ae0e 100644\n--- a/app/test/test_cryptodev_aes_test_vectors.h\n+++ b/app/test/test_cryptodev_aes_test_vectors.h\n@@ -1533,6 +1533,33 @@ static const struct blockcipher_test_data aes_test_data_4 = {\n \t}\n };\n \n+/** AES-128-CBC Negative test vector */\n+static const struct blockcipher_test_data aes_128_cbc_misalign_test_data = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_aes_common,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes128cbc,\n+\t\t.len = 511\n+\t},\n+};\n+\n /** AES-128-CBC SHA1 test vector (Digest encrypted mode) */\n static const struct blockcipher_test_data aes_test_data_4_digest_enc = {\n \t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n@@ -2000,6 +2027,33 @@ static const struct blockcipher_test_data aes_test_data_10 = {\n \t}\n };\n \n+/** AES-192-CBC neg test vector */\n+static const struct blockcipher_test_data aes_192_cbc_misalign_test_data = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A,\n+\t\t\t0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0\n+\t\t},\n+\t\t.len = 24\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_aes_common,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes192cbc,\n+\t\t.len = 511\n+\t}\n+};\n /** AES-192-CBC SHA1 test vector (Digest encrypted mode) */\n static const struct blockcipher_test_data aes_test_data_10_digest_enc = {\n \t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n@@ -2212,6 +2266,35 @@ static const struct blockcipher_test_data aes_test_data_11 = {\n \t}\n };\n \n+/** AES-256-CBC neg test vector */\n+static const struct blockcipher_test_data aes_256_cbc_misalign_test_data = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A,\n+\t\t\t0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0,\n+\t\t\t0x37, 0x07, 0xB8, 0x23, 0xA2, 0xA3, 0xB5, 0x8D\n+\t\t},\n+\t\t.len = 32\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n+\t\t\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_aes_common,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_aes256cbc,\n+\t\t.len = 511\n+\t}\n+};\n+\n /** AES-256-CBC SHA1 test vector (Digest encrypted mode) */\n static const struct blockcipher_test_data aes_test_data_11_digest_enc = {\n \t.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,\n@@ -5117,6 +5200,42 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {\n \t\t.test_data = &aes_test_data_21,\n \t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n \t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC Encryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_128_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-192-CBC Encryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_192_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-256-CBC Encryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_256_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC Decryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_128_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-192-CBC Decryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_192_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-256-CBC Decryption Negative Test for data misalignment\",\n+\t\t.test_data = &aes_256_cbc_misalign_test_data,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n };\n \n static const struct blockcipher_test_case aes_docsis_test_cases[] = {\ndiff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c\nindex 87a321fac3..afd5fd2f2e 100644\n--- a/app/test/test_cryptodev_blockcipher.c\n+++ b/app/test/test_cryptodev_blockcipher.c\n@@ -100,6 +100,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,\n \tint nb_segs_out = 1;\n \tuint64_t sgl_type = t->sgl_flag;\n \tuint32_t nb_iterates = 0;\n+\tbool validNegTestResult = false;\n \n \trte_cryptodev_info_get(dev_id, &dev_info);\n \tuint64_t feat_flags = dev_info.feature_flags;\n@@ -606,6 +607,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,\n \t\t\tsnprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, \"line %u \"\n \t\t\t\t\"FAILED: Operation failed \"\n \t\t\t\t\"(0x%X)\", __LINE__, op->status);\n+\t\tif (t->feature_mask & BLOCKCIPHER_TEST_NEG_TEST)\n+\t\t\tvalidNegTestResult = true;\n \t\tstatus = TEST_FAILED;\n \t\tgoto error_exit;\n \t}\n@@ -636,6 +639,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,\n \t\t\t\t\"FAILED: %s\", __LINE__,\n \t\t\t\t\"Crypto data not as expected\");\n \t\t\tstatus = TEST_FAILED;\n+\t\t\tif (t->feature_mask & BLOCKCIPHER_TEST_NEG_TEST)\n+\t\t\t\tvalidNegTestResult = true;\n \t\t\tgoto error_exit;\n \t\t}\n \t}\n@@ -655,6 +660,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,\n \t\t\t\t\t\"FAILED: %s\", __LINE__, \"Generated \"\n \t\t\t\t\t\"digest data not as expected\");\n \t\t\t\tstatus = TEST_FAILED;\n+\t\t\t\tif (t->feature_mask & BLOCKCIPHER_TEST_NEG_TEST)\n+\t\t\t\t\tvalidNegTestResult = true;\n \t\t\t\tgoto error_exit;\n \t\t\t}\n \t\t}\n@@ -806,10 +813,19 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,\n \t\t\t}\n \t\t}\n \t}\n-\n-\tsnprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, \"PASS\");\n+\tif ((status == TEST_SUCCESS) &&\n+\t\t((t->feature_mask & BLOCKCIPHER_TEST_NEG_TEST) || (validNegTestResult))) {\n+\t\tsnprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, \"FAIL\");\n+\t\tstatus = TEST_FAILED;\n+\t} else {\n+\t\tsnprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, \"PASS\");\n+\t}\n \n error_exit:\n+\tif (validNegTestResult) {\n+\t\tsnprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, \"PASS\");\n+\t\tstatus = TEST_SUCCESS;\n+\t}\n \tif (!(t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS)) {\n \t\tif (sess)\n \t\t\trte_cryptodev_sym_session_free(dev_id, sess);\ndiff --git a/app/test/test_cryptodev_blockcipher.h b/app/test/test_cryptodev_blockcipher.h\nindex e6f6c18067..b4d890d8cc 100644\n--- a/app/test/test_cryptodev_blockcipher.h\n+++ b/app/test/test_cryptodev_blockcipher.h\n@@ -20,6 +20,7 @@\n #define BLOCKCIPHER_TEST_FEATURE_STOPPER\t0x04 /* stop upon failing */\n #define BLOCKCIPHER_TEST_FEATURE_SG\t\t0x08 /* Scatter Gather */\n #define BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED\t0x10\n+#define BLOCKCIPHER_TEST_NEG_TEST\t0x80 /* MSB Bit is set for negative test */\n \n #define BLOCKCIPHER_TEST_OP_CIPHER\t(BLOCKCIPHER_TEST_OP_ENCRYPT | \\\n \t\t\t\t\tBLOCKCIPHER_TEST_OP_DECRYPT)\ndiff --git a/app/test/test_cryptodev_des_test_vectors.h b/app/test/test_cryptodev_des_test_vectors.h\nindex 3ded90b6d4..9921b77501 100644\n--- a/app/test/test_cryptodev_des_test_vectors.h\n+++ b/app/test/test_cryptodev_des_test_vectors.h\n@@ -541,6 +541,32 @@ triple_des128cbc_test_vector = {\n \t}\n };\n \n+static const struct blockcipher_test_data\n+triple_des128cbc_misalign_test_vector = {\n+\t.crypto_algo = RTE_CRYPTO_CIPHER_3DES_CBC,\n+\t.cipher_key = {\n+\t\t.data = {\n+\t\t\t0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,\n+\t\t\t0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A\n+\t\t},\n+\t\t.len = 16\n+\t},\n+\t.iv = {\n+\t\t.data = {\n+\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n+\t\t},\n+\t\t.len = 8\n+\t},\n+\t.plaintext = {\n+\t\t.data = plaintext_des,\n+\t\t.len = 511\n+\t},\n+\t.ciphertext = {\n+\t\t.data = ciphertext512_des128cbc,\n+\t\t.len = 511\n+\t}\n+};\n+\n static const struct blockcipher_test_data\n triple_des128cbc_sha1_test_vector = {\n \t.crypto_algo = RTE_CRYPTO_CIPHER_3DES_CBC,\n@@ -1183,6 +1209,18 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {\n \t\t.test_descr = \"3DES-192-CTR Decryption\",\n \t\t.test_data = &triple_des192ctr_test_vector,\n \t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n+\t},\n+\t{\n+\t\t.test_descr = \"3DES-128-CBC Encryption Negative Test for data misalignment\",\n+\t\t.test_data = &triple_des128cbc_misalign_test_vector,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n+\t},\n+\t{\n+\t\t.test_descr = \"3DES-128-CBC Decryption Negative Test for data misalignment\",\n+\t\t.test_data = &triple_des128cbc_misalign_test_vector,\n+\t\t.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,\n+\t\t.feature_mask = BLOCKCIPHER_TEST_NEG_TEST,\n \t}\n };\n \n",
    "prefixes": [
        "2/2"
    ]
}