From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 34D69A04A6; Thu, 27 Jan 2022 15:52:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA19C427FC; Thu, 27 Jan 2022 15:51:49 +0100 (CET) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by mails.dpdk.org (Postfix) with ESMTP id AE8BB427E5 for ; Thu, 27 Jan 2022 15:51:48 +0100 (CET) Received: by mail-qt1-f169.google.com with SMTP id i4so2702714qtr.0 for ; Thu, 27 Jan 2022 06:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ga2+F2WdhQPGQa6+n0WhdVmssIAHFiGxO5U5ZDENIFw=; b=LaF38sIZvKHeA9wyDqtibenOyz1qZ6Amg6bkBPXR7aICubJD0lpiHzxpM8sphsZkKR tkxkNtwgFCiDFp9oVzGZ6KkKqH2UroVll5gnj1QgP1zw9+h3mk7S5c0eeGrT7zC6gzWR iV2EJ7m6mVPXkrEYkW+eLOMgqNDANuyazn8BI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ga2+F2WdhQPGQa6+n0WhdVmssIAHFiGxO5U5ZDENIFw=; b=jwY/k6/427cCNUBhfz/qNEGEj3mtZ0IYXbiiLEY6vpWb7EKmlDlm5JjCnM7lcyGud3 2LJZFZaR6mimggNMOsJvoaocUQBsy1w9bpTspwdrWT0bQq+AFRz83kQOqiofG5rOaiNd YM//a4xX5Gkz5m0aQY9yhtG6QfHXyaER2G97bQweVL4LLancD5UyHQFpFELMVNgTFCij BZT+lEfgyjPrRl2Lx0BgJZZtuOgYM5L595NLbgzh2msxZyOtTqCF1cUwA1xPk2dGsLgn QESpWviNrTx6wGEpH6UNcpNltnUgBVQ0onvjdhyrRDrFqLTQ6mwNGe2CC7JkN5XO4tSE EjUA== X-Gm-Message-State: AOAM53057ce/aNi55QqwLEY4w57lGJEwC4RdLbI/aQMfkO32XH3Fsyc3 l3MxJa7VP8HwVpn60FDsxHxHM8rr6BAdIJEqKlxQqPyE69Vm75GFSKJI8ZN5V7zn3OUSHomASwj IPqrv31RR3pEzB5zN5Yr4TvVdIXU4lXN1RopU0T5mkkaI18psCQI= X-Google-Smtp-Source: ABdhPJxztAoiVKIrSreH6sAhGejBuu/azd0ZiT4fkLzdcPrfizn9ND5cjxKaDXD9tSeDpPj34ZSCvw== X-Received: by 2002:ac8:580b:: with SMTP id g11mr2953817qtg.457.1643295107540; Thu, 27 Jan 2022 06:51:47 -0800 (PST) Received: from blo.iol.unh.edu ([2606:4100:3880:1270:8f3:b5b9:6ccc:8a5c]) by smtp.gmail.com with ESMTPSA id 195sm1507324qkf.30.2022.01.27.06.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 06:51:47 -0800 (PST) From: Brandon Lo To: dev@dpdk.org Cc: ciara.power@intel.com, roy.fan.zhang@intel.com, Brandon Lo Subject: [PATCH 2/5] examples/fips_validation: add json info to header Date: Thu, 27 Jan 2022 09:51:39 -0500 Message-Id: <20220127145142.86742-3-blo@iol.unh.edu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127145142.86742-1-blo@iol.unh.edu> References: <20220127145142.86742-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added json-specific functions and other information needed to test the new FIPS test vectors. Signed-off-by: Brandon Lo --- examples/fips_validation/fips_validation.h | 42 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h index aaadf01ba8..e2789df93a 100644 --- a/examples/fips_validation/fips_validation.h +++ b/examples/fips_validation/fips_validation.h @@ -5,6 +5,10 @@ #ifndef _FIPS_VALIDATION_H_ #define _FIPS_VALIDATION_H_ +#ifdef RTE_HAS_JANSSON +#include +#endif /* RTE_HAS_JANSSON */ + #define FIPS_PARSE_ERR(fmt, args) \ RTE_LOG(ERR, USER1, "FIPS parse error" ## fmt ## "\n", ## args) @@ -24,6 +28,9 @@ #define REQ_FILE_PERFIX "req" #define RSP_FILE_PERFIX "rsp" #define FAX_FILE_PERFIX "fax" +#define JSON_FILE_PERFIX "json" + +#define ACVVERSION "1.0" enum fips_test_algorithms { FIPS_TEST_ALGO_AES = 0, @@ -40,7 +47,8 @@ enum fips_test_algorithms { enum file_types { FIPS_TYPE_REQ = 1, FIPS_TYPE_FAX, - FIPS_TYPE_RSP + FIPS_TYPE_RSP, + FIPS_TYPE_JSON, }; enum fips_test_op { @@ -161,6 +169,23 @@ struct gcm_interim_data { uint8_t gen_iv; }; +#ifdef RTE_HAS_JANSSON +struct fips_test_json_info { + /* Information used for reading from json */ + json_t *json_root; + json_t *json_vector_set; + json_t *json_test_group; + json_t *json_test_case; + /* Location of json write output */ + json_t *json_write_root; + json_t *json_write_group; + json_t *json_write_set; + json_t *json_write_case; + /* Other info */ + uint8_t is_sample; +}; +#endif /* RTE_HAS_JANSSON */ + struct fips_test_interim_info { FILE *fp_rd; FILE *fp_wr; @@ -196,6 +221,10 @@ struct fips_test_interim_info { extern struct fips_test_vector vec; extern struct fips_test_interim_info info; +#ifdef RTE_HAS_JANSSON +extern struct fips_test_json_info json_info; +#endif /* RTE_HAS_JANSSON */ + int fips_test_init(const char *req_file_path, const char *rsp_file_path, const char *device_name); @@ -212,6 +241,17 @@ fips_test_parse_one_case(void); void fips_test_write_one_case(void); +#ifdef RTE_HAS_JANSSON +int +fips_test_parse_one_json_vector_set(void); + +int +fips_test_parse_one_json_group(void); + +int +fips_test_parse_one_json_case(void); +#endif /* RTE_HAS_JANSSON */ + int parse_test_aes_init(void); -- 2.25.1