Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106719/?format=api
http://patches.dpdk.org/api/patches/106719/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220129175514.746925-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": "<20220129175514.746925-6-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220129175514.746925-6-blo@iol.unh.edu", "date": "2022-01-29T17:55:14", "name": "[v3,5/5] examples/fips_validation: add json to gcm test", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "17864c5254ebfc8ebb9d480b9e08376f447f7479", "submitter": { "id": 1678, "url": "http://patches.dpdk.org/api/people/1678/?format=api", "name": "Brandon Lo", "email": "blo@iol.unh.edu" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220129175514.746925-6-blo@iol.unh.edu/mbox/", "series": [ { "id": 21426, "url": "http://patches.dpdk.org/api/series/21426/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21426", "date": "2022-01-29T17:55:09", "name": "Add JSON vector set support to fips validation", "version": 3, "mbox": "http://patches.dpdk.org/series/21426/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/106719/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/106719/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 0C4F6A00C4;\n\tSat, 29 Jan 2022 18:55:44 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C522041157;\n\tSat, 29 Jan 2022 18:55:25 +0100 (CET)", "from mail-qv1-f68.google.com (mail-qv1-f68.google.com\n [209.85.219.68]) by mails.dpdk.org (Postfix) with ESMTP id 92DB240041\n for <dev@dpdk.org>; Sat, 29 Jan 2022 18:55:22 +0100 (CET)", "by mail-qv1-f68.google.com with SMTP id d8so8864033qvv.2\n for <dev@dpdk.org>; Sat, 29 Jan 2022 09:55:22 -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 195sm5423654qkf.30.2022.01.29.09.55.21\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 29 Jan 2022 09:55:21 -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=HhV+nhzoXkgvP3wYCuIKQ9G29915TRTYDyslJAMrpBY=;\n b=KfMjLWzL5dAzk+W087Gsr3QeAsW5mpVBHEgqPj/k6zIkTtPq255q+H9sGARAOuZaMP\n T5louN+H0Kn0u3RKVzKcdl9JivFFeYxzv0GXGuice+1JpmC9hO0gmB+SPZmyWsWvP4jA\n KxZQI4hN3L4aIykuNPOwZaQdQMHZz8190U84Y=", "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=HhV+nhzoXkgvP3wYCuIKQ9G29915TRTYDyslJAMrpBY=;\n b=z9Egjeq27DrYCfrzaa5i8AFJO1wz/ijpoGFNCrCHNsA++yRYJfdwEXV42x003Yt51L\n 6pAuDGlpywW7Hy2to2kza57hWmTu7VQBie/GzECcU9PtVGb9/3nvbc557xtvxLSUS6r2\n pxXQ72KxE74CC1fQFeP1jcC2tFno3xdeURkxYsToUE4PWNX12Ij3EgybTm03y3Imnvq9\n lLngf9DtcF2RuQpDgXnrHbGbgY80liCC1fxagvn13v/mjr3NsVWltroC7AtsMejLXH92\n HB0N2g4xZKCbn1d8ih0jtTVINu5AXW+wfKNo9y2DuBOQkwEoesBmHmdso4rzqUk6Eu5Q\n T41w==", "X-Gm-Message-State": "AOAM531Qr2r53BDq71Dl5IgeUwcvzVdbxA1I9vihR4/ASG38DKMtWSBI\n MuLn5sB33ezek2VgQeP6v30aoA==", "X-Google-Smtp-Source": "\n ABdhPJytrcWnGpkVxwqRakuXF5EMIMwQbZchjL51PgFHfJB850r3NOGxb/P+ngw7iYW7hR4cOMMyXQ==", "X-Received": "by 2002:ad4:5be9:: with SMTP id k9mr11477874qvc.45.1643478922068;\n Sat, 29 Jan 2022 09:55:22 -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 v3 5/5] examples/fips_validation: add json to gcm test", "Date": "Sat, 29 Jan 2022 12:55:14 -0500", "Message-Id": "<20220129175514.746925-6-blo@iol.unh.edu>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220129175514.746925-1-blo@iol.unh.edu>", "References": "<20220129170313.489986-1-blo@iol.unh.edu>\n <20220129175514.746925-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---\nv3:\n* fix checkpatch warnings\n\n .../fips_validation/fips_validation_gcm.c | 150 ++++++++++++++++++\n 1 file changed, 150 insertions(+)", "diff": "diff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c\nindex 250d09bf90..5c72dbf790 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,103 @@ 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;\n+\t\t\tconst char *ivGen_str;\n+\n+\t\t\tivGen_obj = json_object_get(json_info.json_test_group, IVGEN_JSON_STR);\n+\t\t\tivGen_str = json_string_value(ivGen_obj);\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} 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": [ "v3", "5/5" ] }{ "id": 106719, "url": "