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 B6ED0A00C4; Sat, 29 Jan 2022 18:55:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A748940E2D; Sat, 29 Jan 2022 18:55:22 +0100 (CET) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mails.dpdk.org (Postfix) with ESMTP id 85D9440E2D for ; Sat, 29 Jan 2022 18:55:19 +0100 (CET) Received: by mail-qk1-f169.google.com with SMTP id j24so6113994qkk.10 for ; Sat, 29 Jan 2022 09:55:19 -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=gwlnmQeD/tOhON2UYqK1AATKV/D3dMUkEaJcvvn1dUg=; b=cEjJQ+1rSQyYI6ruqLGzPJ6VI+BCNlQz4+ZcBvc9//aO8d8mwkDiHEtNkKNHf8eAFK S7c9eH/EzyvXi53hJL7LSo3A3Dp6R+tgyIigkY0Z0YxieqRRoDgrCXlkQ+HxEXBxn4Sy LTUnqN7GXwrPAtwwniEYM2pLrC5P/sw8fUxRo= 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=gwlnmQeD/tOhON2UYqK1AATKV/D3dMUkEaJcvvn1dUg=; b=Yel88a825tB2lAjjewNCEeUpVV7hr2W3g+9rZRGRfG0ioKAUiwZzB1wM95RCcMOzs6 lPbJ+spsbcby5/xMDWTo8L/d//1A/ZtfMZ6srt0wqRJ+eaYzR9vdIdximdJfJkz0JitD DhKhPEomzIJfaxUwgV1Z8Udnwu884gXx7MeiZoDHgATstqSMeLMoVKD5my7Qe2SxrM2e L7VcFG4IS+X33f6830A0+zU0ytd4Y7I5qKBo9pLUN6jX2kL2w6skJcFcwyzrsYXIj2SG L33fLvwLex8T1YC8AZgbs7RpPwM/8NC4CaftfIyceUDHHm+n8DKqRmnWSEPwRyNOZhfa mxDQ== X-Gm-Message-State: AOAM530kFG6+bzGA26tehZJFXjoLUbMteoDgURY0+5FqX5KlV2RdWlHR wcn1MN3yIJPfnkTWuW43Z6wzyNFAHtpqbn3/Mws= X-Google-Smtp-Source: ABdhPJzpBudmjzOBbvTo+oEi8bt6x8nR5jpzEefSlt5d0EIVwimRPMCTdX1gjvc/cecgZE62Bzrcrg== X-Received: by 2002:a37:9444:: with SMTP id w65mr8927831qkd.468.1643478918939; Sat, 29 Jan 2022 09:55:18 -0800 (PST) Received: from blo.hsd1.nh.comcast.net ([2601:187:807e:37c0:8f3:b5b9:6ccc:8a5c]) by smtp.gmail.com with ESMTPSA id 195sm5423654qkf.30.2022.01.29.09.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 09:55:18 -0800 (PST) From: Brandon Lo To: roy.fan.zhang@intel.com, ciara.power@intel.com Cc: dev@dpdk.org, Brandon Lo Subject: [PATCH v3 2/5] examples/fips_validation: add json info to header Date: Sat, 29 Jan 2022 12:55:11 -0500 Message-Id: <20220129175514.746925-3-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> <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 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 --- v2: * fix type of prefix to suffix examples/fips_validation/fips_validation.h | 48 ++++++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h index aaadf01ba8..8e2963faa3 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) @@ -21,9 +25,12 @@ #define POSITIVE_TEST 0 #define NEGATIVE_TEST -1 -#define REQ_FILE_PERFIX "req" -#define RSP_FILE_PERFIX "rsp" -#define FAX_FILE_PERFIX "fax" +#define REQ_FILE_SUFFIX "req" +#define RSP_FILE_SUFFIX "rsp" +#define FAX_FILE_SUFFIX "fax" +#define JSON_FILE_SUFFIX "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