DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH 1/3] cryptodev: modify some field sizes
Date: Mon, 17 Jul 2017 09:29:51 +0100	[thread overview]
Message-ID: <20170717082953.74995-1-pablo.de.lara.guarch@intel.com> (raw)

Crypto keys and digests are not expected
to be big, so using a uint16_t to store
their lengths should be enough.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 doc/guides/rel_notes/release_17_08.rst | 2 ++
 lib/librte_cryptodev/rte_crypto_sym.h  | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index c6281eb..27453a3 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -313,6 +313,7 @@ ABI Changes
 * **Reorganized the ``rte_crypto_sym_cipher_xform`` structure.**
 
   * Added cipher IV length and offset parameters.
+  * Changed field size of key length from size_t to uint16_t.
 
 * **Reorganized the ``rte_crypto_sym_auth_xform`` structure.**
 
@@ -320,6 +321,7 @@ ABI Changes
   * Changed field size of AAD length from uint32_t to uint16_t.
   * Changed field size of digest length from uint32_t to uint16_t.
   * Removed AAD length.
+  * Changed field size of key length from size_t to uint16_t.
 
 * Replaced ``dev_type`` enumeration with uint8_t ``driver_id`` in
   ``rte_cryptodev_info`` and  ``rte_cryptodev`` structures.
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index f9955a4..27439af 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -143,7 +143,7 @@ struct rte_crypto_cipher_xform {
 
 	struct {
 		uint8_t *data;	/**< pointer to key data */
-		size_t length;	/**< key length in bytes */
+		uint16_t length;/**< key length in bytes */
 	} key;
 	/**< Cipher key
 	 *
@@ -306,7 +306,7 @@ struct rte_crypto_auth_xform {
 
 	struct {
 		uint8_t *data;	/**< pointer to key data */
-		size_t length;	/**< key length in bytes */
+		uint16_t length;/**< key length in bytes */
 	} key;
 	/**< Authentication key data.
 	 * The authentication key length MUST be less than or equal to the
@@ -389,7 +389,7 @@ struct rte_crypto_aead_xform {
 
 	struct {
 		uint8_t *data;  /**< pointer to key data */
-		size_t length;   /**< key length in bytes */
+		uint16_t length;/**< key length in bytes */
 	} key;
 
 	struct {
@@ -424,7 +424,7 @@ struct rte_crypto_aead_xform {
 		 */
 	} iv;	/**< Initialisation vector parameters */
 
-	uint32_t digest_length;
+	uint16_t digest_length;
 
 	uint16_t add_auth_data_length;
 	/**< The length of the additional authenticated data (AAD) in bytes. */
-- 
2.9.4

             reply	other threads:[~2017-07-17 16:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17  8:29 Pablo de Lara [this message]
2017-07-17  8:29 ` [dpdk-dev] [PATCH 2/3] cryptodev: rename field name Pablo de Lara
2017-07-18  8:16   ` Trahe, Fiona
2017-07-18 13:50     ` De Lara Guarch, Pablo
2017-07-17  8:29 ` [dpdk-dev] [PATCH 3/3] cryptodev: reorder auth transform Pablo de Lara
2017-07-18  8:19   ` Trahe, Fiona
2017-07-18 13:49     ` De Lara Guarch, Pablo
2017-07-18  8:17 ` [dpdk-dev] [PATCH 1/3] cryptodev: modify some field sizes Trahe, Fiona
2017-07-18 13:50   ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170717082953.74995-1-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).