get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 112087,
    "url": "http://patches.dpdk.org/api/patches/112087/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/44fd84edf20f03e6ccee04f5a93a1a9c9a703a4b.1653925803.git.gmuthukrishn@marvell.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": "<44fd84edf20f03e6ccee04f5a93a1a9c9a703a4b.1653925803.git.gmuthukrishn@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/44fd84edf20f03e6ccee04f5a93a1a9c9a703a4b.1653925803.git.gmuthukrishn@marvell.com",
    "date": "2022-05-30T15:52:43",
    "name": "[v9,09/10] examples/fips_validation: add parsing for aes_cbc",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2f29de229578a29402b92b2f9fa31e1f27d2beeb",
    "submitter": {
        "id": 2301,
        "url": "http://patches.dpdk.org/api/people/2301/?format=api",
        "name": "Gowrishankar Muthukrishnan",
        "email": "gmuthukrishn@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/44fd84edf20f03e6ccee04f5a93a1a9c9a703a4b.1653925803.git.gmuthukrishn@marvell.com/mbox/",
    "series": [
        {
            "id": 23249,
            "url": "http://patches.dpdk.org/api/series/23249/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23249",
            "date": "2022-05-30T15:52:34",
            "name": "Add JSON vector set support to fips validation",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/23249/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/112087/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/112087/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 EF81CA0542;\n\tMon, 30 May 2022 17:53:45 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3BD1742B8F;\n\tMon, 30 May 2022 17:53:22 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 9B00940689\n for <dev@dpdk.org>; Mon, 30 May 2022 17:53:20 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 24UBlFWW015426;\n Mon, 30 May 2022 08:53:20 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3gbk8n61q6-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 30 May 2022 08:53:19 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Mon, 30 May 2022 08:53:17 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Mon, 30 May 2022 08:53:17 -0700",
            "from localhost.localdomain (unknown [10.28.34.38])\n by maili.marvell.com (Postfix) with ESMTP id 917363F70C2;\n Mon, 30 May 2022 08:53:14 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=Fn1tUSjUNrIyed+/xJSnd3eayOV1TISVf7uTqafU6wE=;\n b=Xx+5Ry3703hv1cWvdx5+8ISpgQesxhRFXgpW++/lklqf64HL2YqHL+dBOMoew0qlZ6oi\n xejpO+eumVJihwZDNJ/j9qqd7YCzbYji7iNpeK3Rb9oDOgGhx+3YoKFNNcAn+54bJp2g\n 6q1Kb5clpltLWS9g7oEL3edf4N/7oFkiTl5c9Inu/71y4TRKUfflgfHee7Ick58gVP7A\n 9asyZRsl3C30jGraoFK6r4okVUl9TUD0HfdJZzjgS6r7NpicIdTs08BQRe+YJClXViPi\n jIy0EYj60G6hJoiOJqhlKVJ4oMVlnMWaCeChkoSF2CwrBIuar3LgmWpMhHmFxKrvO/G9 Xg==",
        "From": "Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Fan Zhang <roy.fan.zhang@intel.com>, Brian Dooley\n <brian.dooley@intel.com>, <lylavoie@iol.unh.edu>, Anoob Joseph\n <anoobj@marvell.com>, Archana Muniganti <marchana@marvell.com>, Jerin Jacob\n <jerinj@marvell.com>, Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "Subject": "[v9, 09/10] examples/fips_validation: add parsing for aes_cbc",
        "Date": "Mon, 30 May 2022 21:22:43 +0530",
        "Message-ID": "\n <44fd84edf20f03e6ccee04f5a93a1a9c9a703a4b.1653925803.git.gmuthukrishn@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<cover.1653925803.git.gmuthukrishn@marvell.com>",
        "References": "<cover.1653925803.git.gmuthukrishn@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "OYBNXf-n32f2p368kA3WbEMnM60IwGXt",
        "X-Proofpoint-GUID": "OYBNXf-n32f2p368kA3WbEMnM60IwGXt",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514\n definitions=2022-05-30_07,2022-05-30_01,2022-02-23_01",
        "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": "Added function to parse algorithm for AES_CBC test.\n\nSigned-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>\n--\nv6:\n* fixed local variable initialization in fips_mct_aes_test.\n---\n examples/fips_validation/fips_validation.c    |   8 +-\n examples/fips_validation/fips_validation.h    |   4 +\n .../fips_validation/fips_validation_aes.c     | 223 ++++++++++++++++++\n examples/fips_validation/main.c               |  76 ++++--\n 4 files changed, 284 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex ab4c0d0eca..8cec172a5f 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -120,7 +120,7 @@ fips_test_parse_header(void)\n \n \tfor (i = 0; i < info.nb_vec_lines; i++) {\n \t\tif (!algo_parsed) {\n-\t\t\tif (strstr(info.vec[i], \"AESVS\")) {\n+\t\t\tif (strstr(info.vec[i], \"AES\")) {\n \t\t\t\talgo_parsed = 1;\n \t\t\t\tinfo.algo = FIPS_TEST_ALGO_AES;\n \t\t\t\tret = parse_test_aes_init();\n@@ -458,10 +458,12 @@ fips_test_parse_one_json_vector_set(void)\n \t/* Vector sets contain the algorithm type, and nothing else we need. */\n \tif (strstr(algo_str, \"AES-GCM\"))\n \t\tinfo.algo = FIPS_TEST_ALGO_AES_GCM;\n-\tif (strstr(algo_str, \"HMAC\"))\n+\telse if (strstr(algo_str, \"HMAC\"))\n \t\tinfo.algo = FIPS_TEST_ALGO_HMAC;\n-\tif (strstr(algo_str, \"CMAC\"))\n+\telse if (strstr(algo_str, \"CMAC\"))\n \t\tinfo.algo = FIPS_TEST_ALGO_AES_CMAC;\n+\telse if (strstr(algo_str, \"AES-CBC\"))\n+\t\tinfo.algo = FIPS_TEST_ALGO_AES;\n \telse\n \t\treturn -EINVAL;\n \ndiff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex 88cbb0303e..6385ec4d8d 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -103,6 +103,7 @@ enum fips_aesavs_test_types {\n \tAESAVS_TYPE_VARTXT,\n \tAESAVS_TYPE_MMT,\n \tAESAVS_TYPE_MCT,\n+\tAESAVS_TYPE_AFT,\n };\n \n enum fips_tdes_test_types {\n@@ -262,6 +263,9 @@ parse_test_hmac_json_algorithm(void);\n \n int\n parse_test_cmac_json_init(void);\n+\n+int\n+parse_test_aes_json_init(void);\n #endif /* RTE_HAS_JANSSON */\n \n int\ndiff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c\nindex b3c5e31f32..8db6f4fa31 100644\n--- a/examples/fips_validation/fips_validation_aes.c\n+++ b/examples/fips_validation/fips_validation_aes.c\n@@ -7,6 +7,7 @@\n #include <stdio.h>\n \n #include <rte_cryptodev.h>\n+#include <rte_malloc.h>\n \n #include \"fips_validation.h\"\n \n@@ -25,6 +26,19 @@\n #define OP_ENC_STR\t\"ENCRYPT\"\n #define OP_DEC_STR\t\"DECRYPT\"\n \n+#define ALGO_JSON_STR\t\t\"algorithm\"\n+#define TESTTYPE_JSON_STR\t\"testType\"\n+#define DIR_JSON_STR\t\t\"direction\"\n+#define KEYLEN_JSON_STR\t\t\"keyLen\"\n+\n+#define KEY_JSON_STR\t\"key\"\n+#define IV_JSON_STR\t\"iv\"\n+#define PT_JSON_STR\t\"pt\"\n+#define CT_JSON_STR\t\"ct\"\n+\n+#define OP_ENC_JSON_STR\t\"encrypt\"\n+#define OP_DEC_JSON_STR\t\"decrypt\"\n+\n struct {\n \tuint32_t type;\n \tconst char *desc;\n@@ -37,6 +51,7 @@ struct {\n \t\t{TDES_VARIABLE_TEXT, \"KAT\"},\n \t\t{AESAVS_TYPE_MMT, \"MMT\"},\n \t\t{AESAVS_TYPE_MCT, \"MCT\"},\n+\t\t{AESAVS_TYPE_AFT, \"AFT\"},\n };\n \n struct aes_test_algo {\n@@ -92,6 +107,214 @@ struct fips_test_callback aes_writeback_callbacks[] = {\n \t\t{NULL, NULL, NULL} /**< end pointer */\n };\n \n+#ifdef RTE_HAS_JANSSON\n+struct fips_test_callback aes_dec_json_vectors[] = {\n+\t\t{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.cipher_auth.key},\n+\t\t{IV_JSON_STR, parse_uint8_hex_str, &vec.iv},\n+\t\t{CT_JSON_STR, parse_uint8_hex_str, &vec.ct},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback aes_interim_json_vectors[] = {\n+\t\t{KEYLEN_JSON_STR, parser_read_uint32_bit_val, &vec.cipher_auth.key},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback aes_enc_json_vectors[] = {\n+\t\t{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.cipher_auth.key},\n+\t\t{IV_JSON_STR, parse_uint8_hex_str, &vec.iv},\n+\t\t{PT_JSON_STR, parse_uint8_hex_str, &vec.pt},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+static int\n+parse_test_aes_json_writeback(struct fips_val *val)\n+{\n+\tstruct fips_val tmp_val;\n+\tjson_t *tcId;\n+\n+\ttcId = json_object_get(json_info.json_test_case, \"tcId\");\n+\n+\tjson_info.json_write_case = json_object();\n+\tjson_object_set(json_info.json_write_case, \"tcId\", tcId);\n+\n+\tif (info.op == FIPS_TEST_ENC_AUTH_GEN) {\n+\t\tjson_t *ct;\n+\n+\t\ttmp_val.val = val->val;\n+\t\ttmp_val.len = vec.pt.len;\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\tct = json_string(info.one_line_text);\n+\t\tjson_object_set_new(json_info.json_write_case, CT_JSON_STR, ct);\n+\n+\t\ttmp_val.val = val->val + vec.pt.len;\n+\t\ttmp_val.len = val->len - vec.pt.len;\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t} else {\n+\t\tif (vec.status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\ttmp_val.val = val->val;\n+\t\t\ttmp_val.len = vec.ct.len;\n+\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\t\tjson_object_set_new(json_info.json_write_case, PT_JSON_STR,\n+\t\t\t\t\t\t\t\tjson_string(info.one_line_text));\n+\t\t} else {\n+\t\t\tjson_object_set_new(json_info.json_write_case, \"testPassed\", json_false());\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+parse_test_aes_mct_json_writeback(struct fips_val *val)\n+{\n+\tjson_t *tcId, *resArr, *res, *ct, *pt, *key, *iv;\n+\tstruct fips_val tmp_val;\n+\n+\ttcId = json_object_get(json_info.json_test_case, \"tcId\");\n+\tif (json_info.json_write_case) {\n+\t\tjson_t *wcId;\n+\n+\t\twcId = json_object_get(json_info.json_write_case, \"tcId\");\n+\t\tif (!json_equal(tcId, wcId)) {\n+\t\t\tjson_info.json_write_case = json_object();\n+\t\t\tjson_object_set(json_info.json_write_case, \"tcId\", tcId);\n+\t\t\tjson_object_set(json_info.json_write_case, \"resultsArray\", json_array());\n+\t\t}\n+\t} else {\n+\t\tjson_info.json_write_case = json_object();\n+\t\tjson_object_set(json_info.json_write_case, \"tcId\", tcId);\n+\t\tjson_object_set(json_info.json_write_case, \"resultsArray\", json_array());\n+\t}\n+\n+\tresArr = json_object_get(json_info.json_write_case, \"resultsArray\");\n+\tif (!json_is_array(resArr))\n+\t\treturn -EINVAL;\n+\n+\tres = json_object();\n+\tif (info .op == FIPS_TEST_ENC_AUTH_GEN) {\n+\t\twriteback_hex_str(\"\", info.one_line_text, &vec.cipher_auth.key);\n+\t\tkey = json_string(info.one_line_text);\n+\t\tjson_object_set_new(res, KEY_JSON_STR, key);\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &val[2]);\n+\t\tiv = json_string(info.one_line_text);\n+\t\tjson_object_set_new(res, IV_JSON_STR, iv);\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &val[1]);\n+\t\tpt = json_string(info.one_line_text);\n+\t\tjson_object_set_new(res, PT_JSON_STR, pt);\n+\n+\t\ttmp_val.val = val->val;\n+\t\ttmp_val.len = vec.pt.len;\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\tct = json_string(info.one_line_text);\n+\t\tjson_object_set_new(res, CT_JSON_STR, ct);\n+\n+\t\ttmp_val.val = val->val + vec.pt.len;\n+\t\ttmp_val.len = val->len - vec.pt.len;\n+\n+\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t} else {\n+\t\tif (vec.status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &vec.cipher_auth.key);\n+\t\t\tkey = json_string(info.one_line_text);\n+\t\t\tjson_object_set_new(res, KEY_JSON_STR, key);\n+\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &val[2]);\n+\t\t\tiv = json_string(info.one_line_text);\n+\t\t\tjson_object_set_new(res, IV_JSON_STR, iv);\n+\n+\t\t\ttmp_val.val = val->val;\n+\t\t\ttmp_val.len = vec.ct.len;\n+\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\t\tpt = json_string(info.one_line_text);\n+\t\t\tjson_object_set_new(res, PT_JSON_STR, pt);\n+\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &val[1]);\n+\t\t\tct = json_string(info.one_line_text);\n+\t\t\tjson_object_set_new(res, CT_JSON_STR, ct);\n+\t\t} else {\n+\t\t\tjson_object_set_new(json_info.json_write_case, \"testPassed\", json_false());\n+\t\t}\n+\t}\n+\n+\tjson_array_append_new(resArr, res);\n+\treturn 0;\n+}\n+\n+int\n+parse_test_aes_json_init(void)\n+{\n+\tjson_t *type_obj = json_object_get(json_info.json_test_group, TESTTYPE_JSON_STR);\n+\tjson_t *algo_obj = json_object_get(json_info.json_vector_set, ALGO_JSON_STR);\n+\tconst char *type_str = json_string_value(type_obj);\n+\tconst char *algo_str = json_string_value(algo_obj);\n+\tuint32_t i;\n+\n+\tif (json_info.json_test_group) {\n+\t\tjson_t *direction_obj;\n+\t\tconst char *direction_str;\n+\n+\t\tdirection_obj = json_object_get(json_info.json_test_group, DIR_JSON_STR);\n+\t\tdirection_str = json_string_value(direction_obj);\n+\n+\t\tif (strcmp(direction_str, OP_ENC_JSON_STR) == 0) {\n+\t\t\tinfo.op = FIPS_TEST_ENC_AUTH_GEN;\n+\t\t\tinfo.callbacks = aes_enc_json_vectors;\n+\n+\t\t} else if (strcmp(direction_str, OP_DEC_JSON_STR) == 0) {\n+\t\t\tinfo.op = FIPS_TEST_DEC_AUTH_VERIF;\n+\t\t\tinfo.callbacks = aes_dec_json_vectors;\n+\t\t} else {\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tinfo.interim_callbacks = aes_interim_json_vectors;\n+\t}\n+\n+\tfor (i = 0; i < RTE_DIM(aes_test_types); i++)\n+\t\tif (strstr(type_str, aes_test_types[i].desc)) {\n+\t\t\tinfo.interim_info.aes_data.test_type =\n+\t\t\t\taes_test_types[i].type;\n+\t\t\tbreak;\n+\t\t}\n+\n+\tif (i >= RTE_DIM(aes_test_types))\n+\t\treturn -EINVAL;\n+\n+\tswitch (info.interim_info.aes_data.test_type) {\n+\tcase AESAVS_TYPE_MCT:\n+\t\tinfo.parse_writeback = parse_test_aes_mct_json_writeback;\n+\t\tbreak;\n+\tcase AESAVS_TYPE_AFT:\n+\t\tinfo.parse_writeback = parse_test_aes_json_writeback;\n+\t\tbreak;\n+\tdefault:\n+\t\tinfo.parse_writeback = NULL;\n+\t}\n+\n+\tif (!info.parse_writeback)\n+\t\treturn -EINVAL;\n+\n+\tfor (i = 0; i < RTE_DIM(algo_con); i++)\n+\t\tif (strstr(algo_str, algo_con[i].name)) {\n+\t\t\tinfo.interim_info.aes_data.cipher_algo =\n+\t\t\t\t(uint32_t)algo_con[i].algo;\n+\t\t\tbreak;\n+\t\t}\n+\n+\tif (i >= RTE_DIM(algo_con))\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+#endif /* RTE_HAS_JANSSON */\n+\n static int\n parse_test_aes_writeback(struct fips_val *val)\n {\ndiff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c\nindex 1645fa99e5..332a4110e3 100644\n--- a/examples/fips_validation/main.c\n+++ b/examples/fips_validation/main.c\n@@ -1556,7 +1556,7 @@ fips_mct_aes_test(void)\n #define AES_BLOCK_SIZE\t16\n #define AES_EXTERN_ITER\t100\n #define AES_INTERN_ITER\t1000\n-\tstruct fips_val val = {NULL, 0}, val_key;\n+\tstruct fips_val val[3] = {{NULL, 0},}, val_key,  pt, ct, iv;\n \tuint8_t prev_out[AES_BLOCK_SIZE] = {0};\n \tuint8_t prev_in[AES_BLOCK_SIZE] = {0};\n \tuint32_t i, j, k;\n@@ -1565,11 +1565,16 @@ fips_mct_aes_test(void)\n \tif (info.interim_info.aes_data.cipher_algo == RTE_CRYPTO_CIPHER_AES_ECB)\n \t\treturn fips_mct_aes_ecb_test();\n \n+\tmemset(&pt, 0, sizeof(struct fips_val));\n+\tmemset(&ct, 0, sizeof(struct fips_val));\n+\tmemset(&iv, 0, sizeof(struct fips_val));\n \tfor (i = 0; i < AES_EXTERN_ITER; i++) {\n-\t\tif (i != 0)\n-\t\t\tupdate_info_vec(i);\n+\t\tif (info.file_type != FIPS_TYPE_JSON) {\n+\t\t\tif (i != 0)\n+\t\t\t\tupdate_info_vec(i);\n \n-\t\tfips_test_write_one_case();\n+\t\t\tfips_test_write_one_case();\n+\t\t}\n \n \t\tfor (j = 0; j < AES_INTERN_ITER; j++) {\n \t\t\tret = fips_run_test();\n@@ -1585,7 +1590,7 @@ fips_mct_aes_test(void)\n \t\t\t\treturn ret;\n \t\t\t}\n \n-\t\t\tret = get_writeback_data(&val);\n+\t\t\tret = get_writeback_data(&val[0]);\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n \n@@ -1593,24 +1598,39 @@ fips_mct_aes_test(void)\n \t\t\t\tmemcpy(prev_in, vec.ct.val, AES_BLOCK_SIZE);\n \n \t\t\tif (j == 0) {\n-\t\t\t\tmemcpy(prev_out, val.val, AES_BLOCK_SIZE);\n+\t\t\t\tmemcpy(prev_out, val[0].val, AES_BLOCK_SIZE);\n+\t\t\t\tpt.len = vec.pt.len;\n+\t\t\t\tpt.val = calloc(1, pt.len);\n+\t\t\t\tmemcpy(pt.val, vec.pt.val, pt.len);\n+\n+\t\t\t\tct.len = vec.ct.len;\n+\t\t\t\tct.val = calloc(1, ct.len);\n+\t\t\t\tmemcpy(ct.val, vec.ct.val, ct.len);\n+\n+\t\t\t\tiv.len = vec.iv.len;\n+\t\t\t\tiv.val = calloc(1, iv.len);\n+\t\t\t\tmemcpy(iv.val, vec.iv.val, iv.len);\n \n \t\t\t\tif (info.op == FIPS_TEST_ENC_AUTH_GEN) {\n-\t\t\t\t\tmemcpy(vec.pt.val, vec.iv.val,\n-\t\t\t\t\t\t\tAES_BLOCK_SIZE);\n-\t\t\t\t\tmemcpy(vec.iv.val, val.val,\n-\t\t\t\t\t\t\tAES_BLOCK_SIZE);\n+\t\t\t\t\tmemcpy(vec.pt.val, vec.iv.val, AES_BLOCK_SIZE);\n+\t\t\t\t\tmemcpy(vec.iv.val, val[0].val, AES_BLOCK_SIZE);\n+\t\t\t\t\tval[1].val = pt.val;\n+\t\t\t\t\tval[1].len = pt.len;\n+\t\t\t\t\tval[2].val = iv.val;\n+\t\t\t\t\tval[2].len = iv.len;\n \t\t\t\t} else {\n-\t\t\t\t\tmemcpy(vec.ct.val, vec.iv.val,\n-\t\t\t\t\t\t\tAES_BLOCK_SIZE);\n-\t\t\t\t\tmemcpy(vec.iv.val, prev_in,\n-\t\t\t\t\t\t\tAES_BLOCK_SIZE);\n+\t\t\t\t\tmemcpy(vec.ct.val, vec.iv.val, AES_BLOCK_SIZE);\n+\t\t\t\t\tmemcpy(vec.iv.val, prev_in, AES_BLOCK_SIZE);\n+\t\t\t\t\tval[1].val = ct.val;\n+\t\t\t\t\tval[1].len = ct.len;\n+\t\t\t\t\tval[2].val = iv.val;\n+\t\t\t\t\tval[2].len = iv.len;\n \t\t\t\t}\n \t\t\t\tcontinue;\n \t\t\t}\n \n \t\t\tif (info.op == FIPS_TEST_ENC_AUTH_GEN) {\n-\t\t\t\tmemcpy(vec.iv.val, val.val, AES_BLOCK_SIZE);\n+\t\t\t\tmemcpy(vec.iv.val, val[0].val, AES_BLOCK_SIZE);\n \t\t\t\tmemcpy(vec.pt.val, prev_out, AES_BLOCK_SIZE);\n \t\t\t} else {\n \t\t\t\tmemcpy(vec.iv.val, prev_in, AES_BLOCK_SIZE);\n@@ -1620,33 +1640,38 @@ fips_mct_aes_test(void)\n \t\t\tif (j == AES_INTERN_ITER - 1)\n \t\t\t\tcontinue;\n \n-\t\t\tmemcpy(prev_out, val.val, AES_BLOCK_SIZE);\n+\t\t\tmemcpy(prev_out, val[0].val, AES_BLOCK_SIZE);\n \t\t}\n \n-\t\tinfo.parse_writeback(&val);\n-\t\tfprintf(info.fp_wr, \"\\n\");\n+\t\tinfo.parse_writeback(val);\n+\t\tif (info.file_type != FIPS_TYPE_JSON)\n+\t\t\tfprintf(info.fp_wr, \"\\n\");\n \n-\t\tif (i == AES_EXTERN_ITER - 1)\n+\t\tif (i == AES_EXTERN_ITER - 1) {\n+\t\t\tfree(pt.val);\n+\t\t\tfree(ct.val);\n+\t\t\tfree(iv.val);\n \t\t\tcontinue;\n+\t\t}\n \n \t\t/** update key */\n \t\tmemcpy(&val_key, &vec.cipher_auth.key, sizeof(val_key));\n \t\tfor (k = 0; k < vec.cipher_auth.key.len; k++) {\n \t\t\tswitch (vec.cipher_auth.key.len) {\n \t\t\tcase 16:\n-\t\t\t\tval_key.val[k] ^= val.val[k];\n+\t\t\t\tval_key.val[k] ^= val[0].val[k];\n \t\t\t\tbreak;\n \t\t\tcase 24:\n \t\t\t\tif (k < 8)\n \t\t\t\t\tval_key.val[k] ^= prev_out[k + 8];\n \t\t\t\telse\n-\t\t\t\t\tval_key.val[k] ^= val.val[k - 8];\n+\t\t\t\t\tval_key.val[k] ^= val[0].val[k - 8];\n \t\t\t\tbreak;\n \t\t\tcase 32:\n \t\t\t\tif (k < 16)\n \t\t\t\t\tval_key.val[k] ^= prev_out[k];\n \t\t\t\telse\n-\t\t\t\t\tval_key.val[k] ^= val.val[k - 16];\n+\t\t\t\t\tval_key.val[k] ^= val[0].val[k - 16];\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\treturn -1;\n@@ -1654,10 +1679,10 @@ fips_mct_aes_test(void)\n \t\t}\n \n \t\tif (info.op == FIPS_TEST_DEC_AUTH_VERIF)\n-\t\t\tmemcpy(vec.iv.val, val.val, AES_BLOCK_SIZE);\n+\t\t\tmemcpy(vec.iv.val, val[0].val, AES_BLOCK_SIZE);\n \t}\n \n-\tfree(val.val);\n+\tfree(val[0].val);\n \n \treturn 0;\n }\n@@ -1963,6 +1988,9 @@ fips_test_one_test_group(void)\n \tcase FIPS_TEST_ALGO_AES_CMAC:\n \t\tret = parse_test_cmac_json_init();\n \t\tbreak;\n+\tcase FIPS_TEST_ALGO_AES:\n+\t\tret = parse_test_aes_json_init();\n+\t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n",
    "prefixes": [
        "v9",
        "09/10"
    ]
}