|WARNING| [v2,2/2] crypto/ipsec_mb: Add SHAKE support.

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Mon Oct 12 11:14:09 CEST 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/171071

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-12

# DPDK Patch Review

## Patch 1/2: crypto/ipsec_mb: Add SHA3 support

### ERRORS

None.

### WARNINGS

**pmd_aesni_mb_priv.h line 1252-1253: Incorrect comment about maximum pad size**

The comment states "maximum pad size supported which is 144 bytes for SHA3-224" but this is misleading. The pad size is determined by the hash block size, and SHA3-224 has a block size of 144 bytes, but this is the *rate* (r) of the Keccak sponge, not a traditional HMAC pad size in the same sense as SHA-2. While the buffer sizing is correct (144 bytes is indeed the largest block size among the algorithms), the comment incorrectly identifies this as a "pad" size when it's the sponge rate. This could confuse future maintainers.

Suggested fix: Update the comment to clarify this is the maximum block/rate size:
```c
/* *< HMAC Authentication pads -
 * allocating space for the maximum block
 * size supported which is 144 bytes for
 * SHA3-224
 */
```

## Patch 2/2: crypto/ipsec_mb: Add SHAKE support

### ERRORS

**pmd_aesni_mb_priv.h lines 1164-1165, 1215-1216: SHAKE truncated/full digest lengths are variable**

SHAKE-128 and SHAKE-256 are Extendable Output Functions (XOFs), not fixed-output hash functions. The digest length is a parameter chosen by the caller, not a fixed value. Setting `auth_truncated_digest_byte_lengths` and `auth_digest_byte_lengths` to 64 bytes for both SHAKE algorithms is arbitrary and incorrect.

The capabilities structure correctly shows:
```c
.digest_size = {
    .min = 1,
    .max = 65535,
    .increment = 1
}
```

But the digest length arrays contradict this by hardcoding 64 bytes. This will cause validation failures or incorrect behavior when applications request digest lengths other than 64 bytes.

Lines in question:
```c
[IMB_AUTH_SHAKE128]		= 64,
[IMB_AUTH_SHAKE256]		= 64
```

The PMD needs to handle SHAKE's variable-length output properly. Either:
1. Remove SHAKE from these static arrays and handle digest length validation differently, or
2. Use the maximum value (65535) consistently, or
3. Document why 64 is chosen as a validation constraint if intel-ipsec-mb itself imposes this limit

Without seeing the intel-ipsec-mb library API contract, the current code appears to impose an undocumented 64-byte limit contradicting the advertised capability.

### WARNINGS

None.

---

## FINAL CHECK SUMMARY

**Patch 1/2:**
- 1 Warning about misleading comment regarding pad sizes

**Patch 2/2:**
- 1 Error regarding hardcoded digest lengths for variable-output SHAKE functions

Review-Result: ERROR


More information about the test-report mailing list