Conversation
Add specification for SNOW5G cipher and auth. Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com> Signed-off-by: 0-day Robot <robot@bytheb.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds 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 enumsclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
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 betweenSNOW3G_UEA2andZUC_EEA3doesn't match the enum declaration order inrte_crypto_sym.h, whereSNOW5G_NEA4is defined afterSM4_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_NIA4entry is placed betweenSNOW3G_UIA2andZUC_EIA3in the source code, but in the enum declaration inrte_crypto_sym.h,RTE_CRYPTO_AUTH_SNOW5G_NIA4is defined afterRTE_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
📒 Files selected for processing (3)
doc/guides/cryptodevs/features/default.inilib/cryptodev/rte_crypto_sym.hlib/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_NEA4enum 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_NIA4enum value is properly added at the end of the enum definition, following the documented ABI stability guidelines. The documentation format is consistent with the existingSNOW3G_UIA2entry.
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:
Documentation:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.