get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64273,
    "url": "http://patches.dpdk.org/api/patches/64273/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1578389923-18041-1-git-send-email-marchana@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": "<1578389923-18041-1-git-send-email-marchana@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1578389923-18041-1-git-send-email-marchana@marvell.com",
    "date": "2020-01-07T09:38:43",
    "name": "examples/fips_validation: add AES XTS support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "37cbd959a27514b7a2fc52aa053852fd6dcd23fb",
    "submitter": {
        "id": 1515,
        "url": "http://patches.dpdk.org/api/people/1515/?format=api",
        "name": "Archana Muniganti",
        "email": "marchana@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/1578389923-18041-1-git-send-email-marchana@marvell.com/mbox/",
    "series": [
        {
            "id": 8005,
            "url": "http://patches.dpdk.org/api/series/8005/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8005",
            "date": "2020-01-07T09:38:43",
            "name": "examples/fips_validation: add AES XTS support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8005/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64273/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64273/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D0A0FA046B;\n\tTue,  7 Jan 2020 15:51:42 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 168561D9C1;\n\tTue,  7 Jan 2020 15:51:42 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C1B201D57F;\n Tue,  7 Jan 2020 10:39:16 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 0079aOks003853; Tue, 7 Jan 2020 01:39:16 -0800",
            "from sc-exch01.marvell.com ([199.233.58.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 2xcn0b0fsc-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 07 Jan 2020 01:39:15 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Jan\n 2020 01:39:13 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Tue, 7 Jan 2020 01:39:12 -0800",
            "from hyd1409.caveonetworks.com.com (unknown [10.29.45.15])\n by maili.marvell.com (Postfix) with ESMTP id 52C383F703F;\n Tue,  7 Jan 2020 01:39:09 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-type; s=pfpt0818;\n bh=l4RODlFB04aTnp524zM7i8KurF9d86313PRnSEKg4gI=;\n b=KFi9DJnq63J6/Ptkfnht3lA03PBhDCNeLuGyxtb883+5Jn7wHA9UnHrUhiy5FBMh4qpD\n mvZzdYcZMuc7ZwTN8MGi3eXowCJw91C20ym+OXa1WBkK9xPxq+Wm8morrBr+IDFmN75G\n +MfDFKvyzviOyyFh1/Vv4DXPnL0o5EhiNTnWOnqZshbh/qX67nBhdwL3ZCC0VGBN6NGb\n mTGnLXVSsgU/v8r532wiCHM/jxTwFYvt0v7i6D80iEWZt9wF0GEnp2pED7hRJPozUUXN\n 08UE/GCt/8eCORHJf/ZKSg2mHq2xOCExlsdbXBbVZR6c2addsugGj+fLZNG91xyafZQv zw==",
        "From": "Archana Muniganti <marchana@marvell.com>",
        "To": "<marko.kovacevic@intel.com>, <akhil.goyal@nxp.com>",
        "CC": "Sucharitha Sarananaga <ssarananaga@marvell.com>, <anoobj@marvell.com>,\n <jerinj@marvell.com>, <dev@dpdk.org>, <stable@dpdk.org>, Abed Kamaluddin\n <akamaluddin@marvell.com>, Archana Muniganti <marchana@marvell.com>",
        "Date": "Tue, 7 Jan 2020 15:08:43 +0530",
        "Message-ID": "<1578389923-18041-1-git-send-email-marchana@marvell.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,18.0.572\n definitions=2020-01-07_02:2020-01-06,2020-01-07 signatures=0",
        "X-Mailman-Approved-At": "Tue, 07 Jan 2020 15:51:40 +0100",
        "Subject": "[dpdk-dev] [PATCH] examples/fips_validation: add AES XTS support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Sucharitha Sarananaga <ssarananaga@marvell.com>\n\nAES XTS support is added to fips application. Parse test-vectors\nfrom input files, populate AES XTS tests and prepare AES XTS\noperations for fips validation.\n\nSigned-off-by: Abed Kamaluddin <akamaluddin@marvell.com>\nSigned-off-by: Archana Muniganti <marchana@marvell.com>\nSigned-off-by: Sucharitha Sarananaga <ssarananaga@marvell.com>\n---\n examples/fips_validation/Makefile              |   1 +\n examples/fips_validation/fips_validation.c     |   6 ++\n examples/fips_validation/fips_validation.h     |   4 +\n examples/fips_validation/fips_validation_xts.c | 119 +++++++++++++++++++++++++\n examples/fips_validation/main.c                |  45 ++++++++++\n examples/fips_validation/meson.build           |   1 +\n 6 files changed, 176 insertions(+)\n create mode 100644 examples/fips_validation/fips_validation_xts.c",
    "diff": "diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile\nindex 1385e8c..c207d11 100644\n--- a/examples/fips_validation/Makefile\n+++ b/examples/fips_validation/Makefile\n@@ -14,6 +14,7 @@ SRCS-y += fips_validation_cmac.c\n SRCS-y += fips_validation_ccm.c\n SRCS-y += fips_validation_sha.c\n SRCS-y += fips_dev_self_test.c\n+SRCS-y += fips_validation_xts.c\n SRCS-y += main.c\n \n # Build using pkg-config variables if possible\ndiff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex 07ffa62..ef24b72 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -150,6 +150,12 @@\n \t\t\t\tret = parse_test_sha_init();\n \t\t\t\tif (ret < 0)\n \t\t\t\t\treturn ret;\n+\t\t\t} else if (strstr(info.vec[i], \"XTS\")) {\n+\t\t\t\talgo_parsed = 1;\n+\t\t\t\tinfo.algo = FIPS_TEST_ALGO_AES_XTS;\n+\t\t\t\tret = parse_test_xts_init();\n+\t\t\t\tif (ret < 0)\n+\t\t\t\t\treturn ret;\n \t\t\t}\n \t\t}\n \ndiff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex d487fb0..5aee955 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -31,6 +31,7 @@ enum fips_test_algorithms {\n \t\tFIPS_TEST_ALGO_HMAC,\n \t\tFIPS_TEST_ALGO_TDES,\n \t\tFIPS_TEST_ALGO_SHA,\n+\t\tFIPS_TEST_ALGO_AES_XTS,\n \t\tFIPS_TEST_ALGO_MAX\n };\n \n@@ -223,6 +224,9 @@ struct fips_test_interim_info {\n parse_test_sha_init(void);\n \n int\n+parse_test_xts_init(void);\n+\n+int\n parser_read_uint8_hex(uint8_t *value, const char *p);\n \n int\ndiff --git a/examples/fips_validation/fips_validation_xts.c b/examples/fips_validation/fips_validation_xts.c\nnew file mode 100644\nindex 0000000..5bb1966\n--- /dev/null\n+++ b/examples/fips_validation/fips_validation_xts.c\n@@ -0,0 +1,119 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <string.h>\n+#include <stdio.h>\n+#include <time.h>\n+\n+#include <rte_cryptodev.h>\n+\n+#include \"fips_validation.h\"\n+\n+#define MODE_STR\t\"XTS\"\n+#define ALGO_STR\t\"test data for \"\n+#define OP_STR\t\t\"State\"\n+#define KEY_SIZE_STR\t\"Key Length : \"\n+\n+#define COUNT_STR\t\"COUNT = \"\n+#define KEY_STR\t\t\"Key = \"\n+#define IV_STR\t\t\"i = \"\n+#define PT_STR\t\t\"PT = \"\n+#define CT_STR\t\t\"CT = \"\n+\n+#define OP_ENC_STR\t\"ENCRYPT\"\n+#define OP_DEC_STR\t\"DECRYPT\"\n+\n+static int\n+parse_interim_xts_enc_dec(const char *key,\n+\t\t__rte_unused char *text,\n+\t\t__rte_unused struct fips_val *val)\n+{\n+\tif (strcmp(key, OP_ENC_STR) == 0)\n+\t\tinfo.op = FIPS_TEST_ENC_AUTH_GEN;\n+\telse if (strcmp(key, OP_DEC_STR) == 0)\n+\t\tinfo.op = FIPS_TEST_DEC_AUTH_VERIF;\n+\telse\n+\t\treturn -1;\n+\treturn 0;\n+}\n+\n+struct fips_test_callback xts_tests_vectors[] = {\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.cipher_auth.key},\n+\t\t{IV_STR, parse_uint8_hex_str, &vec.iv},\n+\t\t{PT_STR, parse_uint8_hex_str, &vec.pt},\n+\t\t{CT_STR, parse_uint8_hex_str, &vec.ct},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback xts_tests_interim_vectors[] = {\n+\t\t{OP_ENC_STR, parse_interim_xts_enc_dec, NULL},\n+\t\t{OP_DEC_STR, parse_interim_xts_enc_dec, NULL},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback xts_writeback_callbacks[] = {\n+\t\t/** First element is used to pass COUNT string */\n+\t\t{COUNT_STR, NULL, NULL},\n+\t\t{IV_STR, writeback_hex_str, &vec.iv},\n+\t\t{KEY_STR, writeback_hex_str, &vec.cipher_auth.key},\n+\t\t{PT_STR, writeback_hex_str, &vec.pt},\n+\t\t{CT_STR, writeback_hex_str, &vec.ct},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+static int\n+parse_test_xts_writeback(struct fips_val *val)\n+{\n+\tif (info.op == FIPS_TEST_ENC_AUTH_GEN)\n+\t\tfprintf(info.fp_wr, \"%s\", CT_STR);\n+\telse\n+\t\tfprintf(info.fp_wr, \"%s\", PT_STR);\n+\n+\tparse_write_hex_str(val);\n+\treturn 0;\n+}\n+\n+static int\n+rsp_test_xts_check(struct fips_val *val)\n+{\n+\tstruct fips_val *data;\n+\tif (info.op == FIPS_TEST_ENC_AUTH_GEN)\n+\t\tdata = &vec.ct;\n+\telse\n+\t\tdata = &vec.pt;\n+\n+\tif (memcmp(val->val, data->val, val->len) == 0)\n+\t\tfprintf(info.fp_wr, \"Success\\n\");\n+\telse\n+\t\tfprintf(info.fp_wr, \"Failed\\n\");\n+\treturn 0;\n+}\n+\n+int parse_test_xts_init(void)\n+{\n+\tchar *tmp;\n+\tuint32_t i;\n+\tfor (i = 0; i < info.nb_vec_lines; i++) {\n+\t\tchar *line = info.vec[i];\n+\t\ttmp = strstr(line, KEY_SIZE_STR);\n+\t\tif (tmp) {\n+\t\t\ttmp += (strlen(KEY_SIZE_STR) + strlen(\"AES\"));\n+\t\t\tif (parser_read_uint32(\n+\t\t\t\t&info.interim_info.aes_data.key_len,\n+\t\t\t\t\ttmp) < 0)\n+\t\t\t\treturn -EINVAL;\n+\t\t\tinfo.interim_info.aes_data.key_len =\n+\t\t\t(info.interim_info.aes_data.key_len*2) / 8;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t}\n+\tinfo.parse_writeback = parse_test_xts_writeback;\n+\tinfo.callbacks = xts_tests_vectors;\n+\tinfo.interim_callbacks = xts_tests_interim_vectors;\n+\tinfo.writeback_callbacks = xts_writeback_callbacks;\n+\tinfo.kat_check = rsp_test_xts_check;\n+\n+\treturn 0;\n+}\ndiff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c\nindex 9a2c8da..f9b2056 100644\n--- a/examples/fips_validation/main.c\n+++ b/examples/fips_validation/main.c\n@@ -912,6 +912,46 @@ struct fips_test_ops {\n \treturn 0;\n }\n \n+static int\n+prepare_xts_xform(struct rte_crypto_sym_xform *xform)\n+{\n+\tconst struct rte_cryptodev_symmetric_capability *cap;\n+\tstruct rte_cryptodev_sym_capability_idx cap_idx;\n+\tstruct rte_crypto_cipher_xform *cipher_xform = &xform->cipher;\n+\n+\txform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\n+\tcipher_xform->algo = RTE_CRYPTO_CIPHER_AES_XTS;\n+\tcipher_xform->op = (info.op == FIPS_TEST_ENC_AUTH_GEN) ?\n+\t\t\tRTE_CRYPTO_CIPHER_OP_ENCRYPT :\n+\t\t\tRTE_CRYPTO_CIPHER_OP_DECRYPT;\n+\tcipher_xform->key.data = vec.cipher_auth.key.val;\n+\tcipher_xform->key.length = vec.cipher_auth.key.len;\n+\tcipher_xform->iv.length = vec.iv.len;\n+\tcipher_xform->iv.offset = IV_OFF;\n+\n+\tcap_idx.algo.cipher = RTE_CRYPTO_CIPHER_AES_XTS;\n+\tcap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\n+\tcap = rte_cryptodev_sym_capability_get(env.dev_id, &cap_idx);\n+\tif (!cap) {\n+\t\tRTE_LOG(ERR, USER1, \"Failed to get capability for cdev %u\\n\",\n+\t\t\t\tenv.dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (rte_cryptodev_sym_capability_check_cipher(cap,\n+\t\t\tcipher_xform->key.length,\n+\t\t\tcipher_xform->iv.length) != 0) {\n+\t\tRTE_LOG(ERR, USER1, \"PMD %s key length %u IV length %u\\n\",\n+\t\t\t\tinfo.device_name, cipher_xform->key.length,\n+\t\t\t\tcipher_xform->iv.length);\n+\t\treturn -EPERM;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static void\n get_writeback_data(struct fips_val *val)\n {\n@@ -1486,6 +1526,11 @@ struct fips_test_ops {\n \t\telse\n \t\t\ttest_ops.test = fips_generic_test;\n \t\tbreak;\n+\tcase FIPS_TEST_ALGO_AES_XTS:\n+\t\ttest_ops.prepare_op = prepare_cipher_op;\n+\t\ttest_ops.prepare_xform = prepare_xts_xform;\n+\t\ttest_ops.test = fips_generic_test;\n+\t\tbreak;\n \tdefault:\n \t\tif (strstr(info.file_name, \"TECB\") ||\n \t\t\t\tstrstr(info.file_name, \"TCBC\")) {\ndiff --git a/examples/fips_validation/meson.build b/examples/fips_validation/meson.build\nindex 6dd6308..e2745d2 100644\n--- a/examples/fips_validation/meson.build\n+++ b/examples/fips_validation/meson.build\n@@ -17,6 +17,7 @@ sources = files(\n \t'fips_validation_cmac.c',\n \t'fips_validation_ccm.c',\n \t'fips_validation_sha.c',\n+\t'fips_validation_xts.c',\n \t'fips_dev_self_test.c',\n \t'main.c'\n )\n",
    "prefixes": []
}