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 67779A00C4; Sat, 29 Jan 2022 18:03:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23F99410E3; Sat, 29 Jan 2022 18:03:21 +0100 (CET) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by mails.dpdk.org (Postfix) with ESMTP id 7E39F40041 for ; Sat, 29 Jan 2022 18:03:18 +0100 (CET) Received: by mail-qt1-f177.google.com with SMTP id y8so7846168qtn.8 for ; Sat, 29 Jan 2022 09:03:18 -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=6rkXOfM7b5MpQ/9vS6B3jjlMIKMhW2oqul/I7EKfcSc=; b=JbE9gPHDsZ78iuxH7KEptUZa3v961Zc3SNT1+6tHVwq95yJlnJN7s9QCq4USRQIYrU YDqJQTLAF6znjKu0+yV18qFe3w38OTFeeQEx2cULb5BFz3KgduKDGIi+kXnq+l956R7x ZqpPUtqvJ8C3O0y+sR1mAyST9r3vSwF3dE/wA= 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=6rkXOfM7b5MpQ/9vS6B3jjlMIKMhW2oqul/I7EKfcSc=; b=1nAQb2SZu8qqF5iL7CeQKRA1l9mFRcaLUzFmIha6EJcvv6ak0T+yfaj5b1uJg19kmq vokdzp6e8dZK3W/LrnmMBLzaIiPN8xjxIsNLtSS4Pq8M10RTZucevFt/HDEh1T7az4ha /C5DMaCufeLPpss2HIHr1bg1yJW2jZb8LbqnoPeUTuyn6+K2nQ++8HdExPwXbWOy6nby 9o24Nd5+gnHKpxhHf+gl55fp3m0QpQFQQOiSTzrUPV7kPVqzRFU5ZwiBA2dhOmJDtKuo kqO5MluYU992lLBDMoR8xTdvdfhwrIDtarqCH967gReegP6M9WFdgeapEenW54bQxSIK mn7Q== X-Gm-Message-State: AOAM531xTWQv4qOlrbe954yhS4Ic3ulyLrHe1TqvtfKP2F1SVoS3jgYw wiivDrzTRNVtdEjBiksn7bvSlQ== X-Google-Smtp-Source: ABdhPJwPVXoUhq0as0WqXvzrLEPLb7su4uRpLRlSrNCXoOU/DUOopEoV82cMvH+OIcJRPtwIpuakug== X-Received: by 2002:ac8:5f0e:: with SMTP id x14mr328104qta.612.1643475797934; Sat, 29 Jan 2022 09:03:17 -0800 (PST) Received: from blo.hsd1.nh.comcast.net ([2601:187:807e:37c0:8f3:b5b9:6ccc:8a5c]) by smtp.gmail.com with ESMTPSA id f9sm5411879qkp.94.2022.01.29.09.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 09:03:17 -0800 (PST) From: Brandon Lo To: roy.fan.zhang@intel.com, ciara.power@intel.com Cc: dev@dpdk.org, Brandon Lo Subject: [PATCH v2 2/5] examples/fips_validation: add json info to header Date: Sat, 29 Jan 2022 12:03:10 -0500 Message-Id: <20220129170313.489986-3-blo@iol.unh.edu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220129170313.489986-1-blo@iol.unh.edu> References: <20220127145142.86742-1-blo@iol.unh.edu> <20220129170313.489986-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