get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 110522,
    "url": "http://patches.dpdk.org/api/patches/110522/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220429161559.415645-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": "<20220429161559.415645-6-blo@iol.unh.edu>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220429161559.415645-6-blo@iol.unh.edu",
    "date": "2022-04-29T16:15:56",
    "name": "[v4,5/8] examples/fips_validation: add json to gcm test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0c04a95ef189f7b7cf902bc443cb882947c8059d",
    "submitter": {
        "id": 1678,
        "url": "http://patches.dpdk.org/api/people/1678/?format=api",
        "name": "Brandon Lo",
        "email": "blo@iol.unh.edu"
    },
    "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/20220429161559.415645-6-blo@iol.unh.edu/mbox/",
    "series": [
        {
            "id": 22738,
            "url": "http://patches.dpdk.org/api/series/22738/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22738",
            "date": "2022-04-29T16:15:51",
            "name": "Add JSON vector set support to fips validation",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/22738/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/110522/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/110522/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 3FD32A04FF;\n\tFri, 29 Apr 2022 18:16:37 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E109742836;\n\tFri, 29 Apr 2022 18:16:10 +0200 (CEST)",
            "from mail-qt1-f171.google.com (mail-qt1-f171.google.com\n [209.85.160.171])\n by mails.dpdk.org (Postfix) with ESMTP id 8583D4282C\n for <dev@dpdk.org>; Fri, 29 Apr 2022 18:16:07 +0200 (CEST)",
            "by mail-qt1-f171.google.com with SMTP id f14so6121302qtq.1\n for <dev@dpdk.org>; Fri, 29 Apr 2022 09:16:07 -0700 (PDT)",
            "from blo.iol.unh.edu ([2606:4100:3880:1270:ec49:26fa:daa6:229d])\n by smtp.gmail.com with ESMTPSA id\n k20-20020a05622a03d400b002ec16d2694fsm2081188qtx.39.2022.04.29.09.16.06\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 29 Apr 2022 09:16:06 -0700 (PDT)"
        ],
        "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=wENVn0LZWyicYMNnKLC9Ddl90zKD3W3htvRWFL7r5mU=;\n b=i6FLe1uTqZHhGiTdPQFv1HcOyZpcD87ypTK25HRSbPYDfk1fi4AmcxDpvuwIIi6Zbo\n ba1ZxUurxtbIcVBtm4wCzfg8hpb0+TeXodRLzGB0uKtvv/Kx7XT68JTby5fsddmElShT\n +2zb9rxlj1x/18aVtK0UBc01AzEknGjqpGJC0=",
        "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=wENVn0LZWyicYMNnKLC9Ddl90zKD3W3htvRWFL7r5mU=;\n b=n/NFvcWVez7LJCtVkVl0swvAyJKfh626ufxo+H/y8Q3luqHeohawJteurA4kv9CGbq\n BnCmi5s7bVOcEq6hYPei2gBVzKo2mE8PhA9TIITK+XN9mTdxsVqcOazd7fhygSMkZFb0\n LvLyD6aaNYp62grC0dDVBaFyvJjS1Nhn4oaFR0ADrlPhEIVnNadBPHbhfLZk/bQ+VFq+\n Qm+OFHLIj0Sp/PbNelCUJ2DAM7vzRQ2KAvvJasgQzesWLaqh0xdEeMLwFlj2bqllE4jI\n aiMuEBwJeSP7gIwdEhaPf0nlq2GiDal5lEGs215XAnrr5voU20xCg3piuSEslZItuNaZ\n phaA==",
        "X-Gm-Message-State": "AOAM532IK4iz7zoaUYLUVoeFgcL10q15/RDfUoqmenYavy+ihzZqDtoU\n NBYUhCEeh+ct6PsnuTPdi8mJGg==",
        "X-Google-Smtp-Source": "\n ABdhPJzF8H5q87aoTFqL8SDxJfqDOYNnZmTAHoJ2Kwm/SzlrxQkd4Hzk0AQa/gSBpFpzDlTHODQvcA==",
        "X-Received": "by 2002:a05:622a:1904:b0:2f3:9101:ac7d with SMTP id\n w4-20020a05622a190400b002f39101ac7dmr131452qtc.277.1651248966945;\n Fri, 29 Apr 2022 09:16:06 -0700 (PDT)",
        "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 v4 5/8] examples/fips_validation: add json to gcm test",
        "Date": "Fri, 29 Apr 2022 12:15:56 -0400",
        "Message-Id": "<20220429161559.415645-6-blo@iol.unh.edu>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220429161559.415645-1-blo@iol.unh.edu>",
        "References": "<20220129175514.746925-1-blo@iol.unh.edu>\n <20220429161559.415645-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 examples/fips_validation/fips_validation.h    |   3 +\n .../fips_validation/fips_validation_gcm.c     | 151 +++++++++++++++++-\n examples/fips_validation/main.c               |   3 +-\n 3 files changed, 155 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex e2789df93a..8d7af99e04 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -250,6 +250,9 @@ fips_test_parse_one_json_group(void);\n \n int\n fips_test_parse_one_json_case(void);\n+\n+int\n+parse_test_gcm_json_init(void);\n #endif /* RTE_HAS_JANSSON */\n \n int\ndiff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c\nindex 250d09bf90..3604b21f13 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@@ -194,7 +253,6 @@ parse_test_gcm_init(void)\n \tchar *tmp;\n \tuint32_t i;\n \n-\n \tfor (i = 0; i < info.nb_vec_lines; i++) {\n \t\tchar *line = info.vec[i];\n \n@@ -218,3 +276,94 @@ parse_test_gcm_init(void)\n \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+\n+int\n+parse_test_gcm_json_init(void)\n+{\n+\tjson_t *direction_obj;\n+\tconst char *direction_str;\n+\n+\tdirection_obj = json_object_get(json_info.json_test_group, DIR_JSON_STR);\n+\tdirection_str = json_string_value(direction_obj);\n+\n+\tif (strcmp(direction_str, OP_ENC_JSON_STR) == 0) {\n+\t\tjson_t *ivGen_obj = json_object_get(json_info.json_test_group, IVGEN_JSON_STR);\n+\t\tconst char *ivGen_str = json_string_value(ivGen_obj);\n+\n+\t\tinfo.op = FIPS_TEST_ENC_AUTH_GEN;\n+\t\tinfo.callbacks = gcm_enc_json_vectors;\n+\n+\t\tif (strcmp(ivGen_str, OP_ENC_INT_JSON_STR) == 0)\n+\t\t\tinfo.interim_info.gcm_data.gen_iv = 1;\n+\t} else if (strcmp(direction_str, OP_DEC_JSON_STR) == 0) {\n+\t\tinfo.op = FIPS_TEST_DEC_AUTH_VERIF;\n+\t\tinfo.callbacks = gcm_dec_json_vectors;\n+\t} else {\n+\t\treturn -EINVAL;\n+\t}\n+\tinfo.interim_callbacks = gcm_interim_json_vectors;\n+\tinfo.parse_writeback = parse_test_gcm_json_writeback;\n+\n+\treturn 0;\n+}\n+#endif /* RTE_HAS_JANSSON */\n+\ndiff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c\nindex 65f736f3cb..a1d8a1d758 100644\n--- a/examples/fips_validation/main.c\n+++ b/examples/fips_validation/main.c\n@@ -1941,11 +1941,12 @@ fips_test_one_test_group(void)\n \n \tswitch (info.algo) {\n \tcase FIPS_TEST_ALGO_AES_GCM:\n-\t\tret = parse_test_gcm_init();\n+\t\tret = parse_test_gcm_json_init();\n \t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n+\n \tif (ret < 0)\n \t\treturn ret;\n \n",
    "prefixes": [
        "v4",
        "5/8"
    ]
}