DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Cc: dev <dev@dpdk.org>, Fan Zhang <roy.fan.zhang@intel.com>,
	 Brian Dooley <brian.dooley@intel.com>,
	Anoob Joseph <anoobj@marvell.com>,
	 Archana Muniganti <marchana@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>
Subject: Re: [PATCH v1] examples/fips_validation: add parsing for xts
Date: Tue, 28 Jun 2022 13:57:16 +0200	[thread overview]
Message-ID: <CAJFAV8wgfYtnivoyMkZiOEG6-RCk+iWK8xOY89qH+zTekVke9w@mail.gmail.com> (raw)
In-Reply-To: <41b2b4d16799a311ea63536b3009052c0cf99d75.1656402995.git.gmuthukrishn@marvell.com>

On Tue, Jun 28, 2022 at 9:59 AM Gowrishankar Muthukrishnan
<gmuthukrishn@marvell.com> wrote:
>
> Added function to parse algorithm for AES XTS test.
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
>  examples/fips_validation/fips_validation.c    |   4 +-
>  examples/fips_validation/fips_validation.h    |  17 ++-
>  .../fips_validation/fips_validation_xts.c     | 126 ++++++++++++++++++
>  examples/fips_validation/main.c               |   5 +
>  4 files changed, 150 insertions(+), 2 deletions(-)
>
> diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
> index 324abccb14..f181363ef7 100644
> --- a/examples/fips_validation/fips_validation.c
> +++ b/examples/fips_validation/fips_validation.c
> @@ -463,7 +463,9 @@ fips_test_parse_one_json_vector_set(void)
>         else if (strstr(algo_str, "CMAC"))
>                 info.algo = FIPS_TEST_ALGO_AES_CMAC;
>         else if (strstr(algo_str, "AES-CBC"))
> -               info.algo = FIPS_TEST_ALGO_AES;
> +               info.algo = FIPS_TEST_ALGO_AES_CBC;

Is this part related to adding xts support?
It looks more like a fix.


> +       else if (strstr(algo_str, "AES-XTS"))
> +               info.algo = FIPS_TEST_ALGO_AES_XTS;
>         else
>                 return -EINVAL;
>
> diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
> index 69d738b718..8ae849c46f 100644
> --- a/examples/fips_validation/fips_validation.h
> +++ b/examples/fips_validation/fips_validation.h
> @@ -34,13 +34,14 @@
>
>  enum fips_test_algorithms {
>                 FIPS_TEST_ALGO_AES = 0,
> +               FIPS_TEST_ALGO_AES_CBC,
>                 FIPS_TEST_ALGO_AES_GCM,
>                 FIPS_TEST_ALGO_AES_CMAC,
>                 FIPS_TEST_ALGO_AES_CCM,
> +               FIPS_TEST_ALGO_AES_XTS,
>                 FIPS_TEST_ALGO_HMAC,
>                 FIPS_TEST_ALGO_TDES,
>                 FIPS_TEST_ALGO_SHA,
> -               FIPS_TEST_ALGO_AES_XTS,
>                 FIPS_TEST_ALGO_MAX
>  };
>
> @@ -170,7 +171,17 @@ struct gcm_interim_data {
>         uint8_t gen_iv;
>  };
>
> +

No need for another blank line.

>  #ifdef USE_JANSSON
> +enum xts_tweak_modes {
> +  XTS_TWEAK_MODE_HEX = 0,
> +  XTS_TWEAK_MODE_NUMBER
> +};
> +
> +struct xts_interim_data {
> +       enum xts_tweak_modes tweak_mode;
> +};
> +
>  struct fips_test_json_info {
>         /* Information used for reading from json */
>         json_t *json_root;
> @@ -207,6 +218,7 @@ struct fips_test_interim_info {
>                 struct ccm_interim_data ccm_data;
>                 struct sha_interim_data sha_data;
>                 struct gcm_interim_data gcm_data;
> +               struct xts_interim_data xts_data;
>         } interim_info;
>
>         enum fips_test_op op;
> @@ -266,6 +278,9 @@ parse_test_cmac_json_init(void);
>
>  int
>  parse_test_aes_json_init(void);
> +
> +int
> +parse_test_xts_json_init(void);
>  #endif /* USE_JANSSON */
>
>  int
> diff --git a/examples/fips_validation/fips_validation_xts.c b/examples/fips_validation/fips_validation_xts.c
> index 5bb1966f6c..2de852c1fc 100644
> --- a/examples/fips_validation/fips_validation_xts.c
> +++ b/examples/fips_validation/fips_validation_xts.c
> @@ -24,6 +24,22 @@
>  #define OP_ENC_STR     "ENCRYPT"
>  #define OP_DEC_STR     "DECRYPT"
>
> +#define ALGO_JSON_STR          "algorithm"
> +#define TESTTYPE_JSON_STR      "testType"
> +#define DIR_JSON_STR           "direction"
> +#define KEYLEN_JSON_STR                "keyLen"
> +#define TWEAKMODE_JSON_STR     "tweakMode"
> +
> +#define KEY_JSON_STR           "key"
> +#define DATAUNITLEN_JSON_STR   "dataUnitLen"
> +#define PAYLOADLEN_JSON_STR    "payloadLen"
> +#define TWEAKVALUE_JSON_STR    "tweakValue"
> +#define PT_JSON_STR    "pt"
> +#define CT_JSON_STR    "ct"
> +
> +#define OP_ENC_JSON_STR        "encrypt"
> +#define OP_DEC_JSON_STR        "decrypt"
> +
>  static int
>  parse_interim_xts_enc_dec(const char *key,
>                 __rte_unused char *text,
> @@ -62,6 +78,116 @@ struct fips_test_callback xts_writeback_callbacks[] = {
>                 {NULL, NULL, NULL} /**< end pointer */
>  };
>
> +#ifdef RTE_HAS_JANSSON

Code in examples can't rely on internal RTE_HAS_JANSSON.


-- 
David Marchand


  reply	other threads:[~2022-06-28 11:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  7:58 Gowrishankar Muthukrishnan
2022-06-28 11:57 ` David Marchand [this message]
2022-06-29  9:14   ` [EXT] " Gowrishankar Muthukrishnan
2022-06-28 13:12 ` [PATCH v2] " Gowrishankar Muthukrishnan
2022-06-29  8:07   ` Zhang, Roy Fan
2022-06-29  9:52   ` [PATCH v3 0/3] example/fips_validation: add xts and sha json parsing Gowrishankar Muthukrishnan
2022-06-29  9:52     ` [PATCH v3 1/3] examples/fips_validation: add aes_cbc specific enum Gowrishankar Muthukrishnan
2022-06-29  9:52     ` [PATCH v3 2/3] examples/fips_validation: add parsing for xts Gowrishankar Muthukrishnan
2022-06-29  9:52     ` [PATCH v3 3/3] examples/fips_validation: add parsing for sha Gowrishankar Muthukrishnan
2022-06-29 12:35     ` [PATCH v4 0/3] example/fips_validation: add xts and sha json parsing Gowrishankar Muthukrishnan
2022-06-29 12:35       ` [PATCH v4 1/3] examples/fips_validation: add aes_cbc specific enum Gowrishankar Muthukrishnan
2022-06-29 12:35       ` [PATCH v4 2/3] examples/fips_validation: add parsing for xts Gowrishankar Muthukrishnan
2022-06-29 12:35       ` [PATCH v4 3/3] examples/fips_validation: add parsing for sha Gowrishankar Muthukrishnan
2022-06-30  4:22       ` [EXT] [PATCH v4 0/3] example/fips_validation: add xts and sha json parsing Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8wgfYtnivoyMkZiOEG6-RCk+iWK8xOY89qH+zTekVke9w@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=anoobj@marvell.com \
    --cc=brian.dooley@intel.com \
    --cc=dev@dpdk.org \
    --cc=gmuthukrishn@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=marchana@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).