On Thu, 17 Sep 2026 15:34:19 +0000
Kai Ji <[email protected]> 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 <[email protected]>
> ---

Wycheproof validation example (v3) - review

Applied on 6bbb7b3, built with -Dwerror=true, ran against
crypto_openssl on 12 Wycheproof v1 files (GCM, CCM, ChaCha20-Poly1305,
HMAC-SHA1/256, CMAC, GMAC, DSA, ECDSA, ECDH). No validation failures
on supported vectors.

Errors
------

doc/guides/sample_app_ug/wycheproof_validation.rst:5
  Title underline is 28 characters under a 29-character title:
    Wycheproof Validation Example
    ============================
  docutils reports "Title underline too short"; doc/guides/meson.build
  adds -W under -Dwerror, so the doc build fails. Add one '='.

Warnings
--------

main.c:790-792 validate_aead_vector()
    vector->msg_len > env.mbuf_data_room
  Usable room in a fresh mbuf is data_room - RTE_PKTMBUF_HEADROOM.
  A message inside that 128-byte window passes this check, run_aead()
  returns -EMSGSIZE at line 536, and line 806 (ret != 0) counts it as
  a validation failure, so the exit status is nonzero. Verified:
  --mbuf-dataroom 160 on aes_gcm_test.json gives failed=54, all
  ret=-90. run_hmac(), run_gmac() and compute_hash() have no
  pre-check at all and misclassify the same way (--mbuf-dataroom 128
  on hmac_sha256_test.json: failed=110). Compare against
  env.mbuf_data_room - RTE_PKTMBUF_HEADROOM and map -EMSGSIZE to
  skipped_unsupported in every caller.

main.c:148-151 parse_args()
    if (parse_uint32(optarg, &value) != 0 ||
            !rte_cryptodev_is_valid_dev(value))
    env.dev_id = value;
  rte_cryptodev_is_valid_dev() takes uint8_t; value is truncated
  before the validity check and again on assignment. Verified:
  --cryptodev-id 256 silently runs on device 0 while --cryptodev-id 1
  is correctly rejected. Reject value > UINT8_MAX (or
  >= RTE_CRYPTO_MAX_DEVS) before the call.

main.c:577-580 run_aead(), and the same pattern at 751, 1108, 1190,
1440, 1667
    completed = dequeue_one(env.dev_id);
    if (completed == NULL) {
        ret = -ETIMEDOUT;
        goto out;
    }
  On timeout the op, mbuf, digest/aad buffers and session are freed
  at out: while the enqueued op is still owned by the PMD, then the
  tool moves on to the next vector. A hardware PMD (QAT is named as
  the target) completes into freed memory, and the next dequeue_one()
  can hand back the stale op as the current vector's result. Treat
  -ETIMEDOUT as fatal: propagate it to main() and stop, rather than
  free and continue.

Info
----

main.c:807-808, 817, 918, 998
    memcmp(output, vector->ct, vector->ct_len) != 0
  When msg_len/ct_len is 0, run_aead() leaves *output NULL and
  decode_hex() leaves the vector buffer NULL, so this is
  memcmp(NULL, NULL, 0). Wycheproof has many empty-message vectors.
  glibc declares memcmp nonnull; -fsanitize=nonnull-attribute trips
  on it. Guard with len != 0 &&.

MAINTAINERS:2038
  "Other Example Applications" is alphabetical; the new entry sits
  between FIPS and Flow filtering. Move it after "VMDq examples".

main.c:180
    struct rte_cryptodev_config config = { rte_socket_id(), 1, 0 };
  Positional initializer; use .socket_id/.nb_queue_pairs/.ff_disable.

doc/guides/sample_app_ug/wycheproof_validation.rst
  The documented crypto_openssl PMD advertises no ECDSA or ECDH xform
  capability (rte_openssl_pmd_ops.c capability table), so with the
  documented command line every ECDSA/ECDH vector lands in
  skipped_capability (verified: 0 passed, 241 skipped on
  ecdsa_secp256r1_sha256_p1363_test.json). Worth a sentence that
  asymmetric coverage needs a PMD advertising those xforms.

Review-Result: ERROR

Reply via email to