From: Pablo de Lara Date: Mon, 17 Jul 2017 08:29:51 +0000 (+0100) Subject: cryptodev: decrease key and digest sizes X-Git-Tag: spdx-start~2396 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=799dea57838a89fd447d2208dff035f7307ffb85 cryptodev: decrease key and digest sizes 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 Acked-by: Fiona Trahe --- diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index 6f3b662ca1..cf0b7cb3f9 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -321,6 +321,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.** @@ -328,6 +329,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 f9955a4464..27439af7e7 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. */