get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47728,
    "url": "http://patches.dpdk.org/api/patches/47728/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181102095535.7906-8-marko.kovacevic@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": "<20181102095535.7906-8-marko.kovacevic@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181102095535.7906-8-marko.kovacevic@intel.com",
    "date": "2018-11-02T09:55:34",
    "name": "[v7,7/8] examples/fips_validation: support CCM parsing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a6981439808587e9430d82bceecc8400b836fda5",
    "submitter": {
        "id": 853,
        "url": "http://patches.dpdk.org/api/people/853/?format=api",
        "name": "Kovacevic, Marko",
        "email": "marko.kovacevic@intel.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/20181102095535.7906-8-marko.kovacevic@intel.com/mbox/",
    "series": [
        {
            "id": 2223,
            "url": "http://patches.dpdk.org/api/series/2223/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2223",
            "date": "2018-11-02T09:55:27",
            "name": "FIPS validation capability",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/2223/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47728/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/47728/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 188BE1B3F0;\n\tFri,  2 Nov 2018 10:55:58 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id EBF9D1B3A3\n\tfor <dev@dpdk.org>; Fri,  2 Nov 2018 10:55:52 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Nov 2018 02:55:52 -0700",
            "from silpixa00399502.ir.intel.com (HELO\n\tsilpixa00399502.ger.corp.intel.com) ([10.237.223.218])\n\tby fmsmga001.fm.intel.com with ESMTP; 02 Nov 2018 02:55:51 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,455,1534834800\"; d=\"scan'208\";a=\"104701224\"",
        "From": "\"Kovacevic, Marko\" <marko.kovacevic@intel.com>",
        "To": "akhil.goyal@nxp.com",
        "Cc": "dev@dpdk.org, roy.fan.zhang@intel.com, arkadiuszx.kusztal@intel.com,\n\t\"Kovacevic, Marko\" <marko.kovacevic@intel.com>",
        "Date": "Fri,  2 Nov 2018 09:55:34 +0000",
        "Message-Id": "<20181102095535.7906-8-marko.kovacevic@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20181102095535.7906-1-marko.kovacevic@intel.com>",
        "References": "<20181026110716.42093-1-marko.kovacevic@intel.com>\n\t<20181102095535.7906-1-marko.kovacevic@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 7/8] examples/fips_validation: support CCM\n\tparsing",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Added enablement for CCM parser, to allow the\napplication to parser the ccm request files and to validate all\ntest types supported.\n\nSigned-off-by: Marko Kovacevic <marko.kovacevic@intel.com>\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\nAcked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n---\n examples/fips_validation/Makefile              |   1 +\n examples/fips_validation/fips_validation.c     |   5 +\n examples/fips_validation/fips_validation.h     |  22 ++\n examples/fips_validation/fips_validation_ccm.c | 272 +++++++++++++++++++++++++\n examples/fips_validation/main.c                |  56 ++++-\n examples/fips_validation/meson.build           |   1 +\n 6 files changed, 356 insertions(+), 1 deletion(-)\n create mode 100644 examples/fips_validation/fips_validation_ccm.c",
    "diff": "diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile\nindex 77b15ae..7b1fe34 100644\n--- a/examples/fips_validation/Makefile\n+++ b/examples/fips_validation/Makefile\n@@ -11,6 +11,7 @@ SRCS-y += fips_validation_hmac.c\n SRCS-y += fips_validation_tdes.c\n SRCS-y += fips_validation_gcm.c\n SRCS-y += fips_validation_cmac.c\n+SRCS-y += fips_validation_ccm.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 fdf6f64..a835cc3 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -121,6 +121,11 @@ fips_test_parse_header(void)\n \t\t\tret = parse_test_cmac_init();\n \t\t\tif (ret < 0)\n \t\t\t\treturn 0;\n+\t\t} else if (strstr(info.vec[i], \"CCM\")) {\n+\t\t\tinfo.algo = FIPS_TEST_ALGO_AES_CCM;\n+\t\t\tret = parse_test_ccm_init();\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn 0;\n \t\t} else if (strstr(info.vec[i], \"HMAC\")) {\n \t\t\tinfo.algo = FIPS_TEST_ALGO_HMAC;\n \t\t\tret = parse_test_hmac_init();\ndiff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex 8dffe8e..3e291bc 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -26,6 +26,7 @@ enum fips_test_algorithms {\n \t\tFIPS_TEST_ALGO_AES = 0,\n \t\tFIPS_TEST_ALGO_AES_GCM,\n \t\tFIPS_TEST_ALGO_AES_CMAC,\n+\t\tFIPS_TEST_ALGO_AES_CCM,\n \t\tFIPS_TEST_ALGO_HMAC,\n \t\tFIPS_TEST_ALGO_TDES,\n \t\tFIPS_TEST_ALGO_MAX\n@@ -102,6 +103,14 @@ enum fips_tdes_test_types {\n \tTDES_MMT /* Multi block Message Test */\n };\n \n+enum fips_ccm_test_types {\n+\tCCM_VADT\t= 1, /* Variable Associated Data Test */\n+\tCCM_VPT,\t\t /* Variable Payload Test */\n+\tCCM_VNT,\t\t /* Variable Nonce Test */\n+\tCCM_VTT,\t\t /* Variable Tag Test */\n+\tCCM_DVPT,\t /*  Decryption-Verification Process Test */\n+};\n+\n struct aesavs_interim_data {\n \tenum fips_aesavs_test_types test_type;\n \tuint32_t cipher_algo;\n@@ -117,6 +126,15 @@ struct tdes_interim_data {\n \tuint32_t nb_keys;\n };\n \n+struct ccm_interim_data {\n+\tenum fips_ccm_test_types test_type;\n+\tuint32_t aad_len;\n+\tuint32_t pt_len;\n+\tuint32_t digest_len;\n+\tuint32_t key_len;\n+\tuint32_t iv_len;\n+};\n+\n struct fips_test_interim_info {\n \tFILE *fp_rd;\n \tFILE *fp_wr;\n@@ -131,6 +149,7 @@ struct fips_test_interim_info {\n \t\tstruct aesavs_interim_data aes_data;\n \t\tstruct hmac_interim_data hmac_data;\n \t\tstruct tdes_interim_data tdes_data;\n+\t\tstruct ccm_interim_data ccm_data;\n \n \t} interim_info;\n \n@@ -179,6 +198,9 @@ int\n parse_test_cmac_init(void);\n \n int\n+parse_test_ccm_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_ccm.c b/examples/fips_validation/fips_validation_ccm.c\nnew file mode 100644\nindex 0000000..632999c\n--- /dev/null\n+++ b/examples/fips_validation/fips_validation_ccm.c\n@@ -0,0 +1,272 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+\n+#include <rte_string_fns.h>\n+#include <rte_cryptodev.h>\n+#include <rte_malloc.h>\n+\n+#include \"fips_validation.h\"\n+\n+#define DVPT_STR\t\"CCM-DVPT\"\n+#define VADT_STR\t\"CCM-VADT\"\n+#define VPT_STR\t\t\"CCM-VPT\"\n+#define VNT_STR\t\t\"CCM-VNT\"\n+#define VTT_STR\t\t\"CCM-VTT\"\n+\n+#define PARAM_PREFIX\t\"[\"\n+#define ALEN_PREFIX\t\"Alen = \"\n+#define PLEN_PREFIX\t\"Plen = \"\n+#define IVLEN_PREFIX\t\"Nlen = \"\n+#define DIGESTL_PREFIX\t\"Tlen = \"\n+\n+#define COUNT_STR\t\"Count = \"\n+#define KEY_STR\t\t\"Key = \"\n+#define IV_STR\t\t\"Nonce = \"\n+#define PT_STR\t\t\"Payload = \"\n+#define CT_STR\t\t\"CT = \"\n+#define AAD_STR\t\t\"Adata = \"\n+#define POS_NEG_STR\t\"Result = \"\n+\n+#define POS_KEYWORD\t\"Pass\"\n+#define NEG_KEYWORD\t\"Fail\"\n+\n+static int\n+parser_dvpt_interim(const char *key, char *src, struct fips_val *val)\n+{\n+\tchar *tmp, c, value[10];\n+\tchar num_pattern[] = \"0123456789\";\n+\tint i = 0;\n+\n+\tmemset(value, 0, 10);\n+\n+\ttmp = strstr(src, key);\n+\tif (!tmp)\n+\t\treturn -1;\n+\n+\ttmp += strlen(key);\n+\n+\tc = tmp[0];\n+\n+\twhile (strchr(num_pattern, c) && i < 10) {\n+\t\tvalue[i++] = c;\n+\t\tc = tmp[i];\n+\t}\n+\n+\treturn parser_read_uint32_val(\"\", value, val);\n+}\n+\n+static int\n+parse_dvpt_ct_hex_str(const char *key, char *src, struct fips_val *val)\n+{\n+\tint ret;\n+\n+\tval->len = vec.pt.len;\n+\n+\tret = parse_uint8_known_len_hex_str(key, src, val);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tsrc += strlen(key) + val->len * 2;\n+\n+\tret = parse_uint8_known_len_hex_str(\"\", src, &vec.aead.digest);\n+\tif (ret < 0) {\n+\t\trte_free(val->val);\n+\t\tmemset(val, 0, sizeof(*val));\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+parse_uint8_ccm_aad_str(const char *key, char *src, struct fips_val *val)\n+{\n+\tuint32_t len = val->len, j;\n+\n+\tsrc += strlen(key);\n+\n+\t/* CCM aad requires 18 bytes padding before the real content */\n+\tval->val = rte_zmalloc(NULL, len + 18, 0);\n+\tif (!val->val)\n+\t\treturn -1;\n+\n+\tfor (j = 0; j < len; j++) {\n+\t\tchar byte[3] = {src[j * 2], src[j * 2 + 1], '\\0'};\n+\n+\t\tif (parser_read_uint8_hex(&val->val[j + 18], byte) < 0) {\n+\t\t\trte_free(val->val);\n+\t\t\tmemset(val, 0, sizeof(*val));\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+struct fips_test_callback ccm_vnt_vec[] = {\n+\t\t{IV_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{AAD_STR, parse_uint8_ccm_aad_str, &vec.aead.aad},\n+\t\t{PT_STR, parse_uint8_known_len_hex_str, &vec.pt},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vnt_interim_vec[] = {\n+\t\t{ALEN_PREFIX, parser_read_uint32_val, &vec.aead.aad},\n+\t\t{PLEN_PREFIX, parser_read_uint32_val, &vec.pt},\n+\t\t{DIGESTL_PREFIX, parser_read_uint32_val, &vec.aead.digest},\n+\t\t{IVLEN_PREFIX, parser_read_uint32_val, &vec.iv},\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.aead.key},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vtt_vec[] = {\n+\t\t{AAD_STR, parse_uint8_ccm_aad_str, &vec.aead.aad},\n+\t\t{PT_STR, parse_uint8_known_len_hex_str, &vec.pt},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vtt_interim_vec[] = {\n+\t\t{ALEN_PREFIX, parser_read_uint32_val, &vec.aead.aad},\n+\t\t{PLEN_PREFIX, parser_read_uint32_val, &vec.pt},\n+\t\t{IVLEN_PREFIX, parser_read_uint32_val, &vec.iv},\n+\t\t{DIGESTL_PREFIX, parser_read_uint32_val, &vec.aead.digest},\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.aead.key},\n+\t\t{IV_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vadt_vec[] = {\n+\t\t{AAD_STR, parse_uint8_ccm_aad_str, &vec.aead.aad},\n+\t\t{PT_STR, parse_uint8_known_len_hex_str, &vec.pt},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vadt_interim_vec[] = {\n+\t\t{PLEN_PREFIX, parser_read_uint32_val, &vec.pt},\n+\t\t{IVLEN_PREFIX, parser_read_uint32_val, &vec.iv},\n+\t\t{ALEN_PREFIX, parser_read_uint32_val, &vec.aead.aad},\n+\t\t{DIGESTL_PREFIX, parser_read_uint32_val, &vec.aead.digest},\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.aead.key},\n+\t\t{IV_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vpt_vec[] = {\n+\t\t{AAD_STR, parse_uint8_ccm_aad_str, &vec.aead.aad},\n+\t\t{PT_STR, parse_uint8_known_len_hex_str, &vec.pt},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_vpt_interim_vec[] = {\n+\t\t{ALEN_PREFIX, parser_read_uint32_val, &vec.aead.aad},\n+\t\t{IVLEN_PREFIX, parser_read_uint32_val, &vec.iv},\n+\t\t{DIGESTL_PREFIX, parser_read_uint32_val, &vec.aead.digest},\n+\t\t{PLEN_PREFIX, parser_read_uint32_val, &vec.pt},\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.aead.key},\n+\t\t{IV_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_dvpt_vec[] = {\n+\t\t{IV_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{AAD_STR, parse_uint8_ccm_aad_str, &vec.aead.aad},\n+\t\t{CT_STR, parse_dvpt_ct_hex_str, &vec.ct},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback ccm_dvpt_interim_vec[] = {\n+\t\t{ALEN_PREFIX, parser_dvpt_interim, &vec.aead.aad},\n+\t\t{PLEN_PREFIX, parser_dvpt_interim, &vec.pt},\n+\t\t{IVLEN_PREFIX, parser_dvpt_interim, &vec.iv},\n+\t\t{DIGESTL_PREFIX, parser_dvpt_interim, &vec.aead.digest},\n+\t\t{KEY_STR, parse_uint8_hex_str, &vec.aead.key},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct ccm_test_types {\n+\tconst char *str;\n+\tuint32_t type;\n+\tconst struct fips_test_callback *cb;\n+\tconst struct fips_test_callback *cb_interim;\n+\tenum fips_test_op op;\n+} ctt[] = {\n+\t\t{DVPT_STR, CCM_DVPT, ccm_dvpt_vec, ccm_dvpt_interim_vec,\n+\t\t\tFIPS_TEST_DEC_AUTH_VERIF},\n+\t\t{VPT_STR, CCM_VPT, ccm_vpt_vec, ccm_vpt_interim_vec,\n+\t\t\tFIPS_TEST_ENC_AUTH_GEN},\n+\t\t{VADT_STR, CCM_VADT, ccm_vadt_vec, ccm_vadt_interim_vec,\n+\t\t\tFIPS_TEST_ENC_AUTH_GEN},\n+\t\t{VNT_STR, CCM_VNT, ccm_vnt_vec, ccm_vnt_interim_vec,\n+\t\t\tFIPS_TEST_ENC_AUTH_GEN},\n+\t\t{VTT_STR, CCM_VTT, ccm_vtt_vec, ccm_vtt_interim_vec,\n+\t\t\tFIPS_TEST_ENC_AUTH_GEN},\n+};\n+\n+static int\n+parse_test_ccm_writeback(struct fips_val *val)\n+{\n+\tstruct fips_val tmp_val;\n+\n+\tswitch (info.interim_info.ccm_data.test_type) {\n+\tcase CCM_DVPT:\n+\t\tfprintf(info.fp_wr, \"%s\", POS_NEG_STR);\n+\t\tif (vec.status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\tfprintf(info.fp_wr, \"%s\\n\", POS_KEYWORD);\n+\t\t\tfprintf(info.fp_wr, \"%s\", PT_STR);\n+\n+\t\t\ttmp_val.val = val->val;\n+\t\t\ttmp_val.len = vec.pt.len;\n+\n+\t\t\tif (tmp_val.len == 0)\n+\t\t\t\tfprintf(info.fp_wr, \"00\\n\");\n+\t\t\telse\n+\t\t\t\tparse_write_hex_str(&tmp_val);\n+\t\t} else\n+\t\t\tfprintf(info.fp_wr, \"%s\\n\", NEG_KEYWORD);\n+\n+\t\tbreak;\n+\n+\tcase CCM_VADT:\n+\tcase CCM_VNT:\n+\tcase CCM_VPT:\n+\tcase CCM_VTT:\n+\t\tfprintf(info.fp_wr, \"%s\", CT_STR);\n+\n+\t\tparse_write_hex_str(val);\n+\n+\t\tbreak;\n+\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+parse_test_ccm_init(void)\n+{\n+\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < info.nb_vec_lines; i++) {\n+\t\tchar *line = info.vec[i];\n+\t\tuint32_t j;\n+\n+\t\tfor (j = 0; j < RTE_DIM(ctt); j++)\n+\t\t\tif (strstr(line, ctt[j].str)) {\n+\t\t\t\tinfo.interim_info.ccm_data.test_type =\n+\t\t\t\t\t\tctt[j].type;\n+\t\t\t\tinfo.callbacks = ctt[j].cb;\n+\t\t\t\tinfo.interim_callbacks = ctt[j].cb_interim;\n+\t\t\t\tinfo.op = ctt[j].op;\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tinfo.parse_writeback = parse_test_ccm_writeback;\n+\n+\treturn 0;\n+}\ndiff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c\nindex e953f3e..0a7e75f 100644\n--- a/examples/fips_validation/main.c\n+++ b/examples/fips_validation/main.c\n@@ -470,7 +470,10 @@ prepare_aead_op(void)\n \t__rte_crypto_op_reset(env.op, RTE_CRYPTO_OP_TYPE_SYMMETRIC);\n \trte_pktmbuf_reset(env.mbuf);\n \n-\tmemcpy(iv, vec.iv.val, vec.iv.len);\n+\tif (info.algo == FIPS_TEST_ALGO_AES_CCM)\n+\t\tmemcpy(iv + 1, vec.iv.val, vec.iv.len);\n+\telse\n+\t\tmemcpy(iv, vec.iv.val, vec.iv.len);\n \n \tsym->m_src = env.mbuf;\n \tsym->aead.data.offset = 0;\n@@ -726,6 +729,52 @@ prepare_cmac_xform(struct rte_crypto_sym_xform *xform)\n \treturn 0;\n }\n \n+static int\n+prepare_ccm_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_aead_xform *aead_xform = &xform->aead;\n+\n+\txform->type = RTE_CRYPTO_SYM_XFORM_AEAD;\n+\n+\taead_xform->algo = RTE_CRYPTO_AEAD_AES_CCM;\n+\taead_xform->aad_length = vec.aead.aad.len;\n+\taead_xform->digest_length = vec.aead.digest.len;\n+\taead_xform->iv.offset = IV_OFF;\n+\taead_xform->iv.length = vec.iv.len;\n+\taead_xform->key.data = vec.aead.key.val;\n+\taead_xform->key.length = vec.aead.key.len;\n+\taead_xform->op = (info.op == FIPS_TEST_ENC_AUTH_GEN) ?\n+\t\t\tRTE_CRYPTO_AEAD_OP_ENCRYPT :\n+\t\t\tRTE_CRYPTO_AEAD_OP_DECRYPT;\n+\n+\tcap_idx.algo.aead = aead_xform->algo;\n+\tcap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;\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_aead(cap,\n+\t\t\taead_xform->key.length,\n+\t\t\taead_xform->digest_length, aead_xform->aad_length,\n+\t\t\taead_xform->iv.length) != 0) {\n+\t\tRTE_LOG(ERR, USER1,\n+\t\t\t\"PMD %s key_len %u tag_len %u aad_len %u iv_len %u\\n\",\n+\t\t\t\tinfo.device_name, aead_xform->key.length,\n+\t\t\t\taead_xform->digest_length,\n+\t\t\t\taead_xform->aad_length,\n+\t\t\t\taead_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@@ -1091,6 +1140,11 @@ init_test_ops(void)\n \t\ttest_ops.prepare_xform = prepare_cmac_xform;\n \t\ttest_ops.test = fips_generic_test;\n \t\tbreak;\n+\tcase FIPS_TEST_ALGO_AES_CCM:\n+\t\ttest_ops.prepare_op = prepare_aead_op;\n+\t\ttest_ops.prepare_xform = prepare_ccm_xform;\n+\t\ttest_ops.test = fips_generic_test;\n+\t\tbreak;\n \tdefault:\n \t\treturn -1;\n \t}\ndiff --git a/examples/fips_validation/meson.build b/examples/fips_validation/meson.build\nindex a0d38fa..498c9ba 100644\n--- a/examples/fips_validation/meson.build\n+++ b/examples/fips_validation/meson.build\n@@ -15,5 +15,6 @@ sources = files(\n \t'fips_validation_tdes.c',\n \t'fips_validation_gcm.c',\n \t'fips_validation_cmac.c',\n+\t'fips_validation_ccm.c',\n \t'main.c'\n )\n",
    "prefixes": [
        "v7",
        "7/8"
    ]
}