[v1] cryptodev: clarify usage of the block ciphers

Message ID 20231006130621.694334-1-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v1] cryptodev: clarify usage of the block ciphers |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Power, Ciara Oct. 6, 2023, 1:06 p.m. UTC
  From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>

Some of the API comments incorrectly limited the usage of symmetric
crypto fields to block ciphers.

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 lib/cryptodev/rte_crypto_sym.h | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)
  

Comments

Ji, Kai Oct. 6, 2023, 1:20 p.m. UTC | #1
Acked-by: Kai Ji <kai.ji@intel.com<mailto:kai.ji@intel.com>>
  
Akhil Goyal Oct. 23, 2023, 1:44 p.m. UTC | #2
> Subject: [EXT] [PATCH v1] cryptodev: clarify usage of the block ciphers
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> 
> Some of the API comments incorrectly limited the usage of symmetric
> crypto fields to block ciphers.
> 
> Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 5be0f05397..53b18b9412 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -279,7 +279,7 @@  struct rte_crypto_cipher_xform {
 		 *
 		 * - For block ciphers in CTR mode, this is the length
 		 * of the counter (which must be the same as the block
-		 * length of the cipher).
+		 * length of the cipher) or a 12-byte nonce (AES only)
 		 *
 		 * - For CCM mode, this is the length of the nonce,
 		 * which can be in the range 7 to 13 inclusive.
@@ -643,7 +643,7 @@  struct rte_crypto_sym_op {
 				uint32_t length;
 				 /**< The message length, in bytes, of the source buffer
 				  * on which the cryptographic operation will be
-				  * computed. This must be a multiple of the block size
+				  * computed.
 				  */
 			} data; /**< Data offsets and length for AEAD */
 			struct {
@@ -685,22 +685,12 @@  struct rte_crypto_sym_op {
 				 * and the length encoding in the first two bytes of the
 				 * second block.
 				 *
-				 * - the array should be big enough to hold the above
-				 * fields, plus any padding to round this up to the
-				 * nearest multiple of the block size (16 bytes).
-				 * Padding will be added by the implementation.
-				 *
 				 * - Note that PMDs may modify the memory reserved
 				 * (first 18 bytes and the final padding).
 				 *
 				 * Finally, for GCM (@ref RTE_CRYPTO_AEAD_AES_GCM), the
 				 * caller should setup this field as follows:
 				 *
-				 * - the AAD is written in starting at byte 0
-				 * - the array must be big enough to hold the AAD, plus
-				 * any space to round this up to the nearest multiple
-				 * of the block size (16 bytes).
-				 *
 				 */
 				rte_iova_t phys_addr;	/**< physical address */
 			} aad;
@@ -731,8 +721,9 @@  struct rte_crypto_sym_op {
 					  * source buffer on which the cryptographic
 					  * operation will be computed.
 					  * This is also the same as the result length.
-					  * This must be a multiple of the block size
-					  * or a multiple of data-unit length
+					  * For block ciphers, this must be a
+					  * multiple of the block size,
+					  * or for the AES-XTS a multiple of the data-unit length
 					  * as described in xform.
 					  *
 					  * @note