All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Kai Ji <kai.ji@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v5] examples: add Wycheproof validation app
Date: Tue, 22 Sep 2026 09:26:14 -0700	[thread overview]
Message-ID: <20260922092614.3c9aacf9@phoenix.local> (raw)
In-Reply-To: <20260922160557.2789446-1-kai.ji@intel.com>

On Tue, 22 Sep 2026 16:05:57 +0000
Kai Ji <kai.ji@intel.com> wrote:

> Add a Wycheproof JSON vector validation example for cryptodev PMDs.
> 
> Support these algorithms when advertised by the selected PMD:
> - AEAD: AES-GCM, AES-CCM, SM4-GCM, ChaCha20-Poly1305
> - MAC: AES-CMAC, AES-GMAC, HMAC SHA-1/SHA-2/SHA-3/SM3
> - Asymmetric: DSA (P1363 verify), ECDSA (P1363 verify),
>   ECDH (ecpoint shared-secret compute)
> 
> Validate valid vectors against generated ciphertexts, tags, plaintexts,
> digests, shared secrets, or signature verification, and require the
> expected rejection for invalid vectors. Digest inputs for DSA and ECDSA
> use the symmetric auth path, selecting a separate symmetric-capable
> device when the target device is asymmetric-only.
> 
> Skip parameter combinations outside PMD capability ranges and identify
> recognized vector families without a compatible DPDK transform. A
> --debug option lists every failed or skipped vector.
> 
> Add Meson and standalone build integration, with usage documentation.
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
> ---

AI review had some useful suggestions on this.

Wycheproof validation example (v5) - review

v4 -> v5 delta: drop unused APP_NAME, close the device on the
app_init() error path, and treat asym session-create failure as
-ENOTSUP (skip) instead of -EIO/-ENOMEM (fail) in run_dsa_verify(),
run_ecdh_ecpoint() and run_ecdsa_verify().

Applied on 6bbb7b3, built with -Dwerror=true, docutils clean. Same
crypto_openssl runs as v4: directory run passed=1902 failed=0,
--mbuf-dataroom 160 and --cryptodev-id 256 behave as in v4.

No Errors or Warnings.

Info
----

main.c:1222, 1480, 1715
    ret = -ENOTSUP;
  Session-create failure is now indistinguishable from an unsupported
  curve or key size: a PMD that advertises the xform but fails
  session setup for a curve it claims to support, or a -ENOMEM from
  an exhausted asym session pool, lands in skipped_capability and the
  exit status stays zero. Understood that the asym capability struct
  does not enumerate curves, so this is a documented trade-off; just
  noting that valid asym vectors can no longer fail at session setup.

main.c:823-824, 837, 957, 1047 (open since v3)
    memcmp(output, vector->ct, vector->ct_len) != 0
  memcmp(NULL, NULL, 0) for empty-message vectors; glibc declares
  memcmp nonnull. Guard with len != 0 &&.

main.c:182-183, 266 (open since v3)
  Positional struct initializers; use designated members.

doc/guides/sample_app_ug/wycheproof_validation.rst (open since v3)
  crypto_openssl advertises no ECDSA/ECDH xform capability, so the
  documented command line skips every ECDSA/ECDH vector. One sentence
  saying asymmetric coverage needs a PMD advertising those xforms.

Pre-existing, not introduced by this patch
  lib/cryptodev/rte_cryptodev.c:2411 rte_cryptodev_asym_session_create()
    ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
    if (ret < 0) {
        ...
        return ret;
    }
  On configure failure the object stays allocated from the pool and
  *session still points at it, unlike the sym variant which does
  rte_mempool_put() on its error_exit path. This app copes by freeing
  a non-NULL session at out: even when create returned an error; if
  the library is ever aligned with the sym behaviour that becomes a
  double put. One for the cryptodev maintainers, not this patch.

Review-Result: CLEAN

  reply	other threads:[~2026-09-22 16:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 15:51 [PATCH] examples: add Wycheproof validation app Kai Ji
2026-09-15 16:58 ` Stephen Hemminger
2026-09-15 18:28 ` Stephen Hemminger
2026-09-17 15:34 ` [PATCH v3] " Kai Ji
2026-09-21 12:05   ` [EXTERNAL] " Gowrishankar Muthukrishnan
2026-09-21 16:41   ` Stephen Hemminger
2026-09-22 14:47   ` [PATCH v4] " Kai Ji
2026-09-22 16:05     ` [PATCH v5] " Kai Ji
2026-09-22 16:26       ` Stephen Hemminger [this message]
2026-09-23 10:50       ` [PATCH v6] " Kai Ji
2026-09-23 15:04         ` [PATCH v7] " Kai Ji
2026-09-24 14:35           ` [EXTERNAL] " Akhil Goyal
2026-09-24 15:01             ` Ji, Kai
2026-09-24 18:00               ` Akhil Goyal
2026-09-25 16:32                 ` Thomas Monjalon
2026-09-29 16:12                   ` Ji, Kai
2026-09-29 18:21                     ` Akhil Goyal
2026-10-13 15:20           ` [PATCH v8] " Kai Ji
2026-10-13 15:43             ` [PATCH v9] " Kai Ji

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=20260922092614.3c9aacf9@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=kai.ji@intel.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.