Skip to content

[PWCI] "[v2] cryptodev: add SNOW5G spec"#595

Open
ovsrobot wants to merge 1 commit intomainfrom
series_36969
Open

[PWCI] "[v2] cryptodev: add SNOW5G spec"#595
ovsrobot wants to merge 1 commit intomainfrom
series_36969

Conversation

@ovsrobot
Copy link
Owner

@ovsrobot ovsrobot commented Jan 6, 2026

NOTE: This is an auto submission for "[v2] cryptodev: add SNOW5G spec".

See "http://patchwork.dpdk.org/project/dpdk/list/?series=36969" for details.

Summary by Sourcery

Add SNOW 5G NEA4 cipher and NIA4 authentication algorithm support to cryptodev and advertise them in the default cryptodev feature list.

New Features:

  • Introduce SNOW 5G NEA4 as a supported symmetric cipher algorithm in cryptodev.
  • Introduce SNOW 5G NIA4 as a supported authentication algorithm in cryptodev.

Documentation:

  • Document SNOW 5G NEA4 and NIA4 capabilities in the default cryptodev features matrix.

Summary by CodeRabbit

  • New Features
    • Added support for SNOW5G NEA4 cipher algorithm.
    • Added support for SNOW5G NIA4 authentication algorithm.

✏️ Tip: You can customize this high-level summary in your review settings.

Add specification for SNOW5G cipher and auth.

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 6, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds SNOW5G NEA4 cipher and NIA4 authentication algorithm support to cryptodev, including enum definitions, string mappings, and feature documentation entries.

Class diagram for updated cryptodev cipher and auth algorithm enums

classDiagram

class rte_crypto_cipher_algorithm {
  <<enum>>
  RTE_CRYPTO_CIPHER_KASUMI_F8
  RTE_CRYPTO_CIPHER_SNOW3G_UEA2
  RTE_CRYPTO_CIPHER_SNOW5G_NEA4
  RTE_CRYPTO_CIPHER_ZUC_EEA3
  RTE_CRYPTO_CIPHER_SM4_ECB
  RTE_CRYPTO_CIPHER_SM4_CBC
  RTE_CRYPTO_CIPHER_SM4_OFB
  RTE_CRYPTO_CIPHER_SM4_CFB
  RTE_CRYPTO_CIPHER_SM4_XTS
}

class rte_crypto_auth_algorithm {
  <<enum>>
  RTE_CRYPTO_AUTH_KASUMI_F9
  RTE_CRYPTO_AUTH_SNOW3G_UIA2
  RTE_CRYPTO_AUTH_SNOW5G_NIA4
  RTE_CRYPTO_AUTH_ZUC_EIA3
  RTE_CRYPTO_AUTH_SM3
  RTE_CRYPTO_AUTH_SM3_HMAC
}

class crypto_cipher_algorithm_strings {
  +values: const_char_pointer[]
}

class crypto_auth_algorithm_strings {
  +values: const_char_pointer[]
}

crypto_cipher_algorithm_strings ..> rte_crypto_cipher_algorithm : indexed_by
crypto_auth_algorithm_strings ..> rte_crypto_auth_algorithm : indexed_by
Loading

File-Level Changes

Change Details Files
Introduce SNOW5G NEA4 cipher and NIA4 auth algorithms to the public cryptodev API enums.
  • Extend rte_crypto_cipher_algorithm enum with RTE_CRYPTO_CIPHER_SNOW5G_NEA4 after SM4 XTS entry, maintaining trailing commas and comments.
  • Extend rte_crypto_auth_algorithm enum with RTE_CRYPTO_AUTH_SNOW5G_NIA4, with corresponding documentation comments.
lib/cryptodev/rte_crypto_sym.h
Wire new SNOW5G algorithms into cryptodev name lookup tables.
  • Add "snow5g-nea4" string mapping at the index for RTE_CRYPTO_CIPHER_SNOW5G_NEA4 in the crypto_cipher_algorithm_strings array.
  • Add "snow5g-nia4" string mapping at the index for RTE_CRYPTO_AUTH_SNOW5G_NIA4 in the crypto_auth_algorithm_strings array.
lib/cryptodev/rte_cryptodev.c
Advertise SNOW5G NEA4/NIA4 capabilities in the cryptodev default feature matrix.
  • Add SNOW5G NEA4 entry to the cipher feature section alongside other stream ciphers.
  • Add SNOW5G NIA4 entry to the authentication feature section alongside other integrity algorithms.
doc/guides/cryptodevs/features/default.ini

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

This pull request extends cryptographic algorithm support by adding SNOW5G NEA4 and NIA4 to the library. Changes include configuration documentation, public API enum declarations, and string-to-algorithm name mappings across three files.

Changes

Cohort / File(s) Summary
Configuration documentation
doc/guides/cryptodevs/features/default.ini
Added SNOW5G NEA4 and SNOW5G NIA4 to Cipher and Auth sections respectively
Public API declarations
lib/cryptodev/rte_crypto_sym.h
Extended rte_crypto_cipher_algorithm enum with RTE_CRYPTO_CIPHER_SNOW5G_NEA4; extended rte_crypto_auth_algorithm enum with RTE_CRYPTO_AUTH_SNOW5G_NIA4
Algorithm string mappings
lib/cryptodev/rte_cryptodev.c
Added cipher and auth algorithm name mappings: "snow5g-nea4" and "snow5g-nia4" to respective static string tables

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A cryptographic hop and bound,
With SNOW5G algorithms newly crowned,
NEA4, NIA4, so fine and bright,
Three files aligned with symmetric might,
The rabbit's code shines strong today! 🔐

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[PWCI] [v2] cryptodev: add SNOW5G spec' clearly describes the main change: adding SNOW5G cryptographic specification support to the cryptodev library.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
lib/cryptodev/rte_cryptodev.c (2)

98-106: Consider reordering string array entries to match enum declaration order.

While the designated initializer [RTE_CRYPTO_CIPHER_SNOW5G_NEA4] ensures the string is placed at the correct array index at runtime, the source code placement between SNOW3G_UEA2 and ZUC_EEA3 doesn't match the enum declaration order in rte_crypto_sym.h, where SNOW5G_NEA4 is defined after SM4_XTS.

For better code readability and maintainability, consider placing this entry after line 106 (after SM4_XTS) to match the enum order:

 	[RTE_CRYPTO_CIPHER_SNOW3G_UEA2]	= "snow3g-uea2",
-	[RTE_CRYPTO_CIPHER_SNOW5G_NEA4]	= "snow5g-nea4",
 	[RTE_CRYPTO_CIPHER_ZUC_EEA3]	= "zuc-eea3",
 	[RTE_CRYPTO_CIPHER_SM4_ECB]	= "sm4-ecb",
 	[RTE_CRYPTO_CIPHER_SM4_CBC]	= "sm4-cbc",
 	[RTE_CRYPTO_CIPHER_SM4_CTR]	= "sm4-ctr",
 	[RTE_CRYPTO_CIPHER_SM4_CFB]	= "sm4-cfb",
-	[RTE_CRYPTO_CIPHER_SM4_XTS]	= "sm4-xts"
+	[RTE_CRYPTO_CIPHER_SM4_XTS]	= "sm4-xts",
+	[RTE_CRYPTO_CIPHER_SNOW5G_NEA4]	= "snow5g-nea4"

158-167: Consider reordering string array entries to match enum declaration order.

Similar to the cipher algorithm strings, the SNOW5G_NIA4 entry is placed between SNOW3G_UIA2 and ZUC_EIA3 in the source code, but in the enum declaration in rte_crypto_sym.h, RTE_CRYPTO_AUTH_SNOW5G_NIA4 is defined after RTE_CRYPTO_AUTH_SM3_HMAC.

For consistency and maintainability, consider placing this entry after line 163 (after SM3_HMAC):

 	[RTE_CRYPTO_AUTH_SNOW3G_UIA2]	= "snow3g-uia2",
-	[RTE_CRYPTO_AUTH_SNOW5G_NIA4]	= "snow5g-nia4",
 	[RTE_CRYPTO_AUTH_ZUC_EIA3]	= "zuc-eia3",
 	[RTE_CRYPTO_AUTH_SM3]		= "sm3",
-	[RTE_CRYPTO_AUTH_SM3_HMAC]	= "sm3-hmac",
+	[RTE_CRYPTO_AUTH_SM3_HMAC]	= "sm3-hmac",
+	[RTE_CRYPTO_AUTH_SNOW5G_NIA4]	= "snow5g-nia4",

 	[RTE_CRYPTO_AUTH_SHAKE_128]	 = "shake-128",
 	[RTE_CRYPTO_AUTH_SHAKE_256]	 = "shake-256",
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd60dcd and bacb9ef.

📒 Files selected for processing (3)
  • doc/guides/cryptodevs/features/default.ini
  • lib/cryptodev/rte_crypto_sym.h
  • lib/cryptodev/rte_cryptodev.c
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (4)
doc/guides/cryptodevs/features/default.ini (2)

63-63: LGTM: Documentation entry for cipher algorithm properly formatted.

The SNOW5G NEA4 cipher entry is correctly placed and formatted consistently with other algorithm entries.


93-93: LGTM: Documentation entry for authentication algorithm properly formatted.

The SNOW5G NIA4 authentication entry is correctly placed and formatted consistently with other algorithm entries.

lib/cryptodev/rte_crypto_sym.h (2)

181-185: LGTM: Cipher algorithm enum correctly extended following ABI compatibility rules.

The changes follow best practices:

  • Trailing comma added to RTE_CRYPTO_CIPHER_SM4_XTS (line 181) enables future additions without modifying this line
  • New RTE_CRYPTO_CIPHER_SNOW5G_NEA4 enum value added at the end (lines 184-185) per the documented rule "new algorithms should only be added to the end"
  • Documentation format is consistent with existing entries

390-392: LGTM: Authentication algorithm enum correctly extended following ABI compatibility rules.

The new RTE_CRYPTO_AUTH_SNOW5G_NIA4 enum value is properly added at the end of the enum definition, following the documented ABI stability guidelines. The documentation format is consistent with the existing SNOW3G_UIA2 entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants