Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106711/?format=api
http://patches.dpdk.org/api/patches/106711/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220129170313.489986-6-blo@iol.unh.edu/", "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": "<20220129170313.489986-6-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220129170313.489986-6-blo@iol.unh.edu", "date": "2022-01-29T17:03:13", "name": "[v2,5/5] examples/fips_validation: add json to gcm test", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "de1f7b4efd7fe61bffd8b133b8f9e6528df4a0ee", "submitter": { "id": 1678, "url": "http://patches.dpdk.org/api/people/1678/?format=api", "name": "Brandon Lo", "email": "blo@iol.unh.edu" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220129170313.489986-6-blo@iol.unh.edu/mbox/", "series": [ { "id": 21423, "url": "http://patches.dpdk.org/api/series/21423/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21423", "date": "2022-01-29T17:03:08", "name": "Add JSON vector set support to fips validation", "version": 2, "mbox": "http://patches.dpdk.org/series/21423/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/106711/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/106711/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 ED847A00C4;\n\tSat, 29 Jan 2022 18:03:47 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 340454114A;\n\tSat, 29 Jan 2022 18:03:24 +0100 (CET)", "from mail-qk1-f195.google.com (mail-qk1-f195.google.com\n [209.85.222.195])\n by mails.dpdk.org (Postfix) with ESMTP id 8248940DDB\n for <dev@dpdk.org>; Sat, 29 Jan 2022 18:03:21 +0100 (CET)", "by mail-qk1-f195.google.com with SMTP id o10so8387839qkg.0\n for <dev@dpdk.org>; Sat, 29 Jan 2022 09:03:21 -0800 (PST)", "from blo.hsd1.nh.comcast.net\n ([2601:187:807e:37c0:8f3:b5b9:6ccc:8a5c])\n by smtp.gmail.com with ESMTPSA id f9sm5411879qkp.94.2022.01.29.09.03.20\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 29 Jan 2022 09:03:20 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu;\n s=unh-iol;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=knO9ZofTXTekSQS12//DUOk0MLH+na3txgS57wnEIns=;\n b=i/czErq8SX9p9QgdW5ZAjLeWNd+4xtJv+Wdv+M0weQoBrdA3eK9PhMuH8hWwt1xGIJ\n 1FhzlQXHsIZIQCdXuqsH8Sb5xRoj05xmiJhEyaEZoX6XATWIooPFPCOAMgkATJ9RugJM\n fCLtIDQrhPl5KhmAaTeKFrg92NGlQE0CO5MyY=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=knO9ZofTXTekSQS12//DUOk0MLH+na3txgS57wnEIns=;\n b=FUK9MQHSSbz7amm2uwvYkqfCnLueMix7lQTNG3qQ0MJ8owoTNESbTN5k2P9DfprwLa\n h9ZC9uaJROqk30v4S3l8MSjqcce5xixk05I3nW/eDrgHptNNOPjUqhFLnUji2pnH/pjh\n CX4L55+gZWH6hrzl9UDh+Pdrd20qCajBYmiUWCl3xFB3jXKjytIMwjRu6ljxu0JFF8uY\n HHWBKPaArIo1vcy5i9ut9zvRVP+VnYa4dMNBnT7kZpWl6Zsl5U2v//kSj2b/HRvPtTSv\n 92WoO8jOqCtqcHFVhzc40izbMLnZ24iLHROGqeOE1acFYPm8hMvreEnrgwhi0AydcsP4\n 18Pw==", "X-Gm-Message-State": "AOAM533rHaQXgNohBvIw10ftcpEqbK0e4RY+qgBBZ/PtBCiHmfaI8/Xo\n cphHj70jVFwg7P5YszBPbzLl3GgYVUsrXOgP3bk=", "X-Google-Smtp-Source": "\n ABdhPJxsmS20giRrGcTnMVZvzIe0/d/g6619oIzEkg47DkricRYk1pyktqco9QEy9lJfZeNSCrVKLg==", "X-Received": "by 2002:a05:620a:d42:: with SMTP id\n o2mr8433257qkl.51.1643475800957;\n Sat, 29 Jan 2022 09:03:20 -0800 (PST)", "From": "Brandon Lo <blo@iol.unh.edu>", "To": "roy.fan.zhang@intel.com,\n\tciara.power@intel.com", "Cc": "dev@dpdk.org,\n\tBrandon Lo <blo@iol.unh.edu>", "Subject": "[PATCH v2 5/5] examples/fips_validation: add json to gcm test", "Date": "Sat, 29 Jan 2022 12:03:13 -0500", "Message-Id": "<20220129170313.489986-6-blo@iol.unh.edu>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220129170313.489986-1-blo@iol.unh.edu>", "References": "<20220127145142.86742-1-blo@iol.unh.edu>\n <20220129170313.489986-1-blo@iol.unh.edu>", "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": "Adds json-specific testing and writeback function. Allows\nthe user to test AES-GCM vector sets.\n\nSigned-off-by: Brandon Lo <blo@iol.unh.edu>\n---\n .../fips_validation/fips_validation_gcm.c | 149 ++++++++++++++++++\n 1 file changed, 149 insertions(+)", "diff": "diff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c\nindex 250d09bf90..4df20370b6 100644\n--- a/examples/fips_validation/fips_validation_gcm.c\n+++ b/examples/fips_validation/fips_validation_gcm.c\n@@ -6,6 +6,10 @@\n #include <time.h>\n #include <stdio.h>\n \n+#ifdef RTE_HAS_JANSSON\n+#include <jansson.h>\n+#endif /* RTE_HAS_JANSSON */\n+\n #include <rte_cryptodev.h>\n #include <rte_malloc.h>\n \n@@ -37,6 +41,27 @@\n #define OP_ENC_EXT_STR\t\"ExtIV\"\n #define OP_ENC_INT_STR\t\"IntIV\"\n \n+#define KEYLEN_JSON_STR\t\t\"keyLen\"\n+#define IVLEN_JSON_STR\t\t\"ivLen\"\n+#define PAYLOADLEN_JSON_STR\t\"payloadLen\"\n+#define AADLEN_JSON_STR\t\t\"aadLen\"\n+#define TAGLEN_JSON_STR\t\t\"tagLen\"\n+\n+#define KEY_JSON_STR\t\"key\"\n+#define IV_JSON_STR\t\t\"iv\"\n+#define PT_JSON_STR\t\t\"pt\"\n+#define CT_JSON_STR\t\t\"ct\"\n+#define AAD_JSON_STR\t\"aad\"\n+#define TAG_JSON_STR\t\"tag\"\n+#define DIR_JSON_STR \t\"direction\"\n+\n+#define OP_ENC_JSON_STR\t\"encrypt\"\n+#define OP_DEC_JSON_STR\t\"decrypt\"\n+\n+#define IVGEN_JSON_STR\t\"ivGen\"\n+#define OP_ENC_EXT_JSON_STR\t\"external\"\n+#define OP_ENC_INT_JSON_STR\t\"internal\"\n+\n #define NEG_TEST_STR\t\"FAIL\"\n \n /**\n@@ -136,6 +161,40 @@ struct fips_test_callback gcm_enc_vectors[] = {\n \t\t{NULL, NULL, NULL} /**< end pointer */\n };\n \n+#ifdef RTE_HAS_JANSSON\n+struct fips_test_callback gcm_dec_json_vectors[] = {\n+\t\t{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.aead.key},\n+\t\t{IV_JSON_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{CT_JSON_STR, parse_gcm_pt_ct_str, &vec.ct},\n+\t\t{AAD_JSON_STR, parse_gcm_aad_str, &vec.aead.aad},\n+\t\t{TAG_JSON_STR, parse_uint8_known_len_hex_str,\n+\t\t\t\t&vec.aead.digest},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback gcm_interim_json_vectors[] = {\n+\t\t{KEYLEN_JSON_STR, parser_read_uint32_bit_val, &vec.aead.key},\n+\t\t{IVLEN_JSON_STR, parser_read_uint32_bit_val, &vec.iv},\n+\t\t{PAYLOADLEN_JSON_STR, parser_read_gcm_pt_len, &vec.pt},\n+\t\t{PAYLOADLEN_JSON_STR, parser_read_uint32_bit_val, &vec.ct},\n+\t\t/**< The NIST json test vectors use 'payloadLen' to denote input text\n+\t\t * length in case of decrypt & encrypt operations.\n+\t\t */\n+\t\t{AADLEN_JSON_STR, parser_read_uint32_bit_val, &vec.aead.aad},\n+\t\t{TAGLEN_JSON_STR, parser_read_uint32_bit_val,\n+\t\t\t\t&vec.aead.digest},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback gcm_enc_json_vectors[] = {\n+\t\t{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.aead.key},\n+\t\t{IV_JSON_STR, parse_uint8_known_len_hex_str, &vec.iv},\n+\t\t{PT_JSON_STR, parse_gcm_pt_ct_str, &vec.pt},\n+\t\t{AAD_JSON_STR, parse_gcm_aad_str, &vec.aead.aad},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+#endif /* RTE_HAS_JANSSON */\n+\n static int\n parse_test_gcm_writeback(struct fips_val *val)\n {\n@@ -188,12 +247,102 @@ parse_test_gcm_writeback(struct fips_val *val)\n \treturn 0;\n }\n \n+#ifdef RTE_HAS_JANSSON\n+static int\n+parse_test_gcm_json_writeback(struct fips_val *val)\n+{\n+\tstruct fips_val tmp_val;\n+\tjson_t *tcId, *tag;\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\tif (info.interim_info.gcm_data.gen_iv) {\n+\t\t\tjson_t *iv;\n+\t\t\ttmp_val.val = vec.iv.val;\n+\t\t\ttmp_val.len = vec.iv.len;\n+\n+\t\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\t\tiv = json_string(info.one_line_text);\n+\t\t\tjson_object_set_new(json_info.json_write_case, IV_JSON_STR, iv);\n+\n+\t\t\trte_free(vec.iv.val);\n+\t\t\tvec.iv.val = NULL;\n+\t\t}\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\ttag = json_string(info.one_line_text);\n+\t\tjson_object_set_new(json_info.json_write_case, TAG_JSON_STR, tag);\n+\t} else {\n+\t\tif (vec.status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\tif (!info.interim_info.gcm_data.is_gmac) {\n+\t\t\t\ttmp_val.val = val->val;\n+\t\t\t\ttmp_val.len = vec.pt.len;\n+\n+\t\t\t\twriteback_hex_str(\"\", info.one_line_text, &tmp_val);\n+\t\t\t\tjson_object_set_new(json_info.json_write_case, PT_JSON_STR,\n+\t\t\t\t\tjson_string(info.one_line_text));\n+\t\t\t}\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+#endif /* RTE_HAS_JANSSON */\n+\n int\n parse_test_gcm_init(void)\n {\n \tchar *tmp;\n \tuint32_t i;\n \n+#ifdef RTE_HAS_JANSSON\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\tjson_t *ivGen_obj = json_object_get(json_info.json_test_group, IVGEN_JSON_STR);\n+\t\t\tconst char *ivGen_str = json_string_value(ivGen_obj);\n+\n+\t\t\tinfo.op = FIPS_TEST_ENC_AUTH_GEN;\n+\t\t\tinfo.callbacks = gcm_enc_json_vectors;\n+\n+\t\t\tif (strcmp(ivGen_str, OP_ENC_INT_JSON_STR) == 0) {\n+\t\t\t\tinfo.interim_info.gcm_data.gen_iv = 1;\n+\t\t\t}\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 = gcm_dec_json_vectors;\n+\t\t} else {\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tinfo.interim_callbacks = gcm_interim_json_vectors;\n+\t\tinfo.parse_writeback = parse_test_gcm_json_writeback;\n+\n+\t\treturn 0;\n+\t}\n+#endif /* RTE_HAS_JANSSON */\n \n \tfor (i = 0; i < info.nb_vec_lines; i++) {\n \t\tchar *line = info.vec[i];\n", "prefixes": [ "v2", "5/5" ] }{ "id": 106711, "url": "