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

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Mon Oct 12 11:06:12 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 identified.

### WARNINGS

**Release notes formatting (pmd_aesni_mb.c, line 332):**
The comment continuation for the SHA3 support section is missing a closing `#endif` comment block separator. While the preprocessor directive is correct, the coding style in this file shows other `#if IMB_VERSION` blocks with blank lines or clear visual separation. Consider adding a blank line after line 334 (`break;` for `IMB_AUTH_HMAC_SM3`) to maintain visual consistency with the existing style in the file.

**Documentation consistency (pmd_aesni_mb_priv.h, lines 1251-1256):**
The comment for the `pads` union states the maximum pad size is "144 bytes for SHA3-224" but should note this applies to the block size, not the digest. The existing comment says "allocating space for the maximum pad size supported which is 128 bytes for SHA512" - the update changes this to 144 bytes for SHA3-224. Consider clarifying that this refers to the block size used in HMAC padding, not the output digest size, to avoid confusion.

### INFO

**Array size consistency (pmd_aesni_mb_priv.h):**
The `auth_blocksize`, `auth_truncated_digest_byte_lengths`, and `auth_digest_byte_lengths` arrays are extended correctly with SHA3 values. The block sizes (144, 136, 104, 72) match the SHA3 specifications for the respective variants (SHA3-224, SHA3-256, SHA3-384, SHA3-512). The digest sizes are correctly specified as 28, 32, 48, and 64 bytes respectively.

**Capability structure (pmd_aesni_mb_priv.h):**
The added capability structures for SHA3 algorithms correctly specify:
- Block sizes matching the SHA3 specification
- Key size range of 0 for non-keyed variants
- Key size range 1-65535 for HMAC variants
- Digest size ranges allowing truncation (min=1, max=full digest size)

All capability structures follow the existing pattern in the file.

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

### ERRORS

None identified.

### WARNINGS

**Digest size specification (pmd_aesni_mb_priv.h, lines 953, 975):**
The capability structures for SHAKE-128 and SHAKE-256 specify `digest_size.max = 65535`. While SHAKE is an extendable-output function (XOF) and can produce variable-length output, advertising a maximum of 65535 bytes may be misleading if the underlying Intel IPsec Multi-buffer library (`IMB_VERSION(3, 0, 0)`) has practical limits on output length. Verify that the library actually supports arbitrary output lengths up to 65535 bytes, or document the actual supported maximum in comments.

**Truncated digest values (pmd_aesni_mb_priv.h, lines 1164, 1165):**
The `auth_truncated_digest_byte_lengths` array entries for `IMB_AUTH_SHAKE128` and `IMB_AUTH_SHAKE256` are both set to 64 bytes. For extendable-output functions, there is no inherent "truncated" vs "full" length distinction - the output length is a parameter. Consider whether 64 bytes is an appropriate default or if this should match the security strength (16 bytes for SHAKE-128, 32 bytes for SHAKE-256). This should align with the Intel IPsec Multi-buffer library's conventions.

**Consistency with auth_digest_byte_lengths (pmd_aesni_mb_priv.h, lines 1215, 1216):**
The `auth_digest_byte_lengths` array entries for SHAKE are also set to 64 bytes, matching `auth_truncated_digest_byte_lengths`. This is inconsistent with the pattern for other algorithms where `auth_digest_byte_lengths` typically contains the full/standard digest size. For SHAKE, there is no single "full" digest size, but the values should be documented to explain why 64 was chosen.

### INFO

**Feature addition (documentation):**
The release notes correctly document the addition of SHAKE-128 and SHAKE-256 support. The feature matrix in `aesni_mb.ini` is properly updated to mark these algorithms as supported.

**Block size values (pmd_aesni_mb_priv.h):**
SHAKE-128 block size of 168 bytes and SHAKE-256 block size of 136 bytes match the SHA-3 specification (rate values for the respective capacities: 256 bits and 512 bits).

---

## GENERAL OBSERVATIONS

Both patches follow DPDK coding conventions and maintain consistency with the existing codebase structure. The changes are appropriately guarded by `#if IMB_VERSION(3, 0, 0) <= IMB_VERSION_NUM` preprocessor conditionals, ensuring they only compile when the required Intel IPsec Multi-buffer library version is available.

The capability structures, array extensions, and function mappings follow the established patterns in the ipsec_mb PMD. Release notes and documentation are updated atomically with the code changes.

No correctness bugs (memory leaks, use-after-free, race conditions, etc.) were identified in either patch.

Review-Result: WARNING


More information about the test-report mailing list