cryptodev: add auth IV
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.h
index 4e318f0..75b423a 100644 (file)
@@ -119,6 +119,38 @@ extern const char **rte_cyptodev_names;
 #define CDEV_PMD_TRACE(...) (void)0
 #endif
 
+
+
+/**
+ * A macro that points to an offset from the start
+ * of the crypto operation structure (rte_crypto_op)
+ *
+ * The returned pointer is cast to type t.
+ *
+ * @param c
+ *   The crypto operation.
+ * @param o
+ *   The offset from the start of the crypto operation.
+ * @param t
+ *   The type to cast the result into.
+ */
+#define rte_crypto_op_ctod_offset(c, t, o)     \
+       ((t)((char *)(c) + (o)))
+
+/**
+ * A macro that returns the physical address that points
+ * to an offset from the start of the crypto operation
+ * (rte_crypto_op)
+ *
+ * @param c
+ *   The crypto operation.
+ * @param o
+ *   The offset from the start of the crypto operation
+ *   to calculate address from.
+ */
+#define rte_crypto_op_ctophys_offset(c, o)     \
+       (phys_addr_t)((c)->phys_addr + (o))
+
 /**
  * Crypto parameters range description
  */
@@ -152,6 +184,8 @@ struct rte_cryptodev_symmetric_capability {
                        /**< digest size range */
                        struct rte_crypto_param_range aad_size;
                        /**< Additional authentication data size range */
+                       struct rte_crypto_param_range iv_size;
+                       /**< Initialisation vector data size range */
                } auth;
                /**< Symmetric Authentication transform capabilities */
                struct {
@@ -228,6 +262,7 @@ rte_cryptodev_sym_capability_check_cipher(
  * @param      key_size        Auth key size.
  * @param      digest_size     Auth digest size.
  * @param      aad_size        Auth aad size.
+ * @param      iv_size         Auth initial vector size.
  *
  * @return
  *   - Return 0 if the parameters are in range of the capability.
@@ -236,7 +271,8 @@ rte_cryptodev_sym_capability_check_cipher(
 int
 rte_cryptodev_sym_capability_check_auth(
                const struct rte_cryptodev_symmetric_capability *capability,
-               uint16_t key_size, uint16_t digest_size, uint16_t aad_size);
+               uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
+               uint16_t iv_size);
 
 /**
  * Provide the cipher algorithm enum, given an algorithm string