X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_cryptodev%2Frte_crypto_sym.h;h=d3d38e4fa5fe880ea285fdf73997417e96c951eb;hb=d1ad3a1fdf33f1de4c37d767da033965c6b1e6ba;hp=34a6bbf5e819d42ff2b7eaeeb6b05703dcaf3b6d;hpb=6aef763816fd3561c4ba825a0322b3bff3ab9d37;p=dpdk.git diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 34a6bbf5e8..d3d38e4fa5 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -97,7 +97,7 @@ enum rte_crypto_cipher_algorithm { /**< (A)RC4 cipher algorithm */ RTE_CRYPTO_CIPHER_KASUMI_F8, - /**< Kasumi algorithm in F8 mode */ + /**< KASUMI algorithm in F8 mode */ RTE_CRYPTO_CIPHER_SNOW3G_UEA2, /**< SNOW 3G algorithm in UEA2 mode */ @@ -204,7 +204,7 @@ enum rte_crypto_auth_algorithm { /**< AES XCBC algorithm. */ RTE_CRYPTO_AUTH_KASUMI_F9, - /**< Kasumi algorithm in F9 mode. */ + /**< KASUMI algorithm in F9 mode. */ RTE_CRYPTO_AUTH_MD5, /**< MD5 algorithm */ @@ -366,6 +366,25 @@ struct rte_cryptodev_sym_session; * it must have a valid *rte_mbuf* structure attached, via m_src parameter, * which contains the source data which the crypto operation is to be performed * on. + * While the mbuf is in use by a crypto operation no part of the mbuf should be + * changed by the application as the device may read or write to any part of the + * mbuf. In the case of hardware crypto devices some or all of the mbuf + * may be DMAed in and out of the device, so writing over the original data, + * though only the part specified by the rte_crypto_sym_op for transformation + * will be changed. + * Out-of-place (OOP) operation, where the source mbuf is different to the + * destination mbuf, is a special case. Data will be copied from m_src to m_dst. + * The part copied includes all the parts of the source mbuf that will be + * operated on, based on the cipher.data.offset+cipher.data.length and + * auth.data.offset+auth.data.length values in the rte_crypto_sym_op. The part + * indicated by the cipher parameters will be transformed, any extra data around + * this indicated by the auth parameters will be copied unchanged from source to + * destination mbuf. + * Also in OOP operation the cipher.data.offset and auth.data.offset apply to + * both source and destination mbufs. As these offsets are relative to the + * data_off parameter in each mbuf this can result in the data written to the + * destination buffer being at a different alignment, relative to buffer start, + * to the data in the source buffer. */ struct rte_crypto_sym_op { struct rte_mbuf *m_src; /**< source mbuf */ @@ -391,8 +410,9 @@ struct rte_crypto_sym_op { * this location. * * @note - * For SNOW 3G @ RTE_CRYPTO_CIPHER_SNOW3G_UEA2 - * and KASUMI @ RTE_CRYPTO_CIPHER_KASUMI_F8, + * For SNOW 3G @ RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + * KASUMI @ RTE_CRYPTO_CIPHER_KASUMI_F8 + * and ZUC @ RTE_CRYPTO_CIPHER_ZUC_EEA3, * this field should be in bits. */ @@ -416,8 +436,9 @@ struct rte_crypto_sym_op { * field should be set to 0. * * @note - * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UEA2 - * and KASUMI @ RTE_CRYPTO_CIPHER_KASUMI_F8, + * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UEA2, + * KASUMI @ RTE_CRYPTO_CIPHER_KASUMI_F8 + * and ZUC @ RTE_CRYPTO_CIPHER_ZUC_EEA3, * this field should be in bits. */ } data; /**< Data offsets and length for ciphering */ @@ -426,7 +447,7 @@ struct rte_crypto_sym_op { uint8_t *data; /**< Initialisation Vector or Counter. * - * - For block ciphers in CBC or F8 mode, or for Kasumi + * - For block ciphers in CBC or F8 mode, or for KASUMI * in F8 mode, or for SNOW 3G in UEA2 mode, this is the * Initialisation Vector (IV) value. * @@ -454,7 +475,7 @@ struct rte_crypto_sym_op { uint16_t length; /**< Length of valid IV data. * - * - For block ciphers in CBC or F8 mode, or for Kasumi + * - For block ciphers in CBC or F8 mode, or for KASUMI * in F8 mode, or for SNOW 3G in UEA2 mode, this is the * length of the IV (which must be the same as the * block length of the cipher). @@ -490,8 +511,9 @@ struct rte_crypto_sym_op { * used instead * * @note - * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UIA2 - * and KASUMI @ RTE_CRYPTO_AUTH_KASUMI_F9, + * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UIA2, + * KASUMI @ RTE_CRYPTO_AUTH_KASUMI_F9 + * and ZUC @ RTE_CRYPTO_AUTH_ZUC_EIA3, * this field should be in bits. */ @@ -510,8 +532,9 @@ struct rte_crypto_sym_op { * Auth.aad.length is used instead. * * @note - * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UIA2 - * and KASUMI @ RTE_CRYPTO_AUTH_KASUMI_F9, + * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UIA2, + * KASUMI @ RTE_CRYPTO_AUTH_KASUMI_F9 + * and ZUC @ RTE_CRYPTO_AUTH_ZUC_EIA3, * this field should be in bits. */ } data; /**< Data offsets and length for authentication */