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 C7FE0A04FF; Fri, 29 Apr 2022 18:16:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29CB74282B; Fri, 29 Apr 2022 18:16:07 +0200 (CEST) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by mails.dpdk.org (Postfix) with ESMTP id 5822E4281C for ; Fri, 29 Apr 2022 18:16:05 +0200 (CEST) Received: by mail-qt1-f174.google.com with SMTP id y3so6112033qtn.8 for ; Fri, 29 Apr 2022 09:16:05 -0700 (PDT) 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=KlF/101SYbvdeKOLAIhv/QBa8nErtO/O47h2gUhBxRg=; b=P73MR54waYo1NIbEZyw2RItnBWXK0lkWP2Noq9SYnbwylg4rDh/MfZhY/yia9UQKpw Ow177uTutsatMYbrf67PpYKtKBFDIl9tNaZQq/NlbptbabrFYwHq24UenHikT9k6RIzM r7PpZKXRy9cvVkuxmioh3CwAtnipBTkCL4VoY= 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=KlF/101SYbvdeKOLAIhv/QBa8nErtO/O47h2gUhBxRg=; b=6rFsNseFS5ZaGYoyNY8p3+2Rk/g5kvbFGIl/QHIaHYI9SN3Z1CBPkA4I3ojvsf1Li1 YfXy8lndYCdR5WAjm6EqtlqN+JoxHKnKA5YdMl9LI9INYFvLiIUqHJlRNHpZ0MZr1c+0 ItvCkbPqLz9r3hkD8snF/rww9rn5Dz8eeudSvS+2a8Yy9vQJY05xhC6A3k6DBxIH2Uzl wfXt/YaGjW0VAMZLnKWeg2xfDKHR7GtBd9KZcj3QwHZIXS5mowoZAZ9t4mtuhFmKoKIa A/UqAzRyz+3WQuZWZOStyg2MfZld4LhSalKsk6cX9u8/vTmX1gMCa40Js6BcSmJ381NP A27Q== X-Gm-Message-State: AOAM530thtHktrU5meoObXEjJB6RyoH2oW40bzQxGhQ67XfJDwayUK+N lpCTuZyO3Rn9sPfHlewD3mLouA== X-Google-Smtp-Source: ABdhPJzOvJ7iZP7hnIYPJsI99Lm3LVLQ3/sTGSs9bwkSC0L3FD0Zkqo8sAAVXNwY28FLr/90XiFKXQ== X-Received: by 2002:ac8:5902:0:b0:2f3:99cc:d8ca with SMTP id 2-20020ac85902000000b002f399ccd8camr142675qty.83.1651248964414; Fri, 29 Apr 2022 09:16:04 -0700 (PDT) Received: from blo.iol.unh.edu ([2606:4100:3880:1270:ec49:26fa:daa6:229d]) by smtp.gmail.com with ESMTPSA id k20-20020a05622a03d400b002ec16d2694fsm2081188qtx.39.2022.04.29.09.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 09:16:03 -0700 (PDT) From: Brandon Lo To: roy.fan.zhang@intel.com, ciara.power@intel.com Cc: dev@dpdk.org, Brandon Lo Subject: [PATCH v4 2/8] examples/fips_validation: add json info to header Date: Fri, 29 Apr 2022 12:15:53 -0400 Message-Id: <20220429161559.415645-3-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> <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 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 | 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