crypto/octeontx: add supported sessions
[dpdk.git] / drivers / common / cpt / cpt_mcode_defines.h
index 235320c..50657a2 100644 (file)
 #define SG_LIST_HDR_SIZE       (8u)
 #define SG_ENTRY_SIZE          sizeof(sg_comp_t)
 
+#define CPT_DMA_MODE           (1 << 7)
+
+#define CPT_FROM_CTX           0
+#define CPT_FROM_DPTR          1
+
+#define FC_GEN                 0x1
+#define ZUC_SNOW3G             0x2
+#define KASUMI                 0x3
+#define HASH_HMAC              0x4
+
+#define ZS_EA                  0x1
+#define ZS_IA                  0x2
+#define K_F8                   0x4
+#define K_F9                   0x8
+
+#define CPT_OP_CIPHER_ENCRYPT  0x1
+#define CPT_OP_CIPHER_DECRYPT  0x2
+#define CPT_OP_CIPHER_MASK     0x3
+
+#define CPT_OP_AUTH_VERIFY     0x4
+#define CPT_OP_AUTH_GENERATE   0x8
+#define CPT_OP_AUTH_MASK       0xC
+
+#define CPT_OP_ENCODE  (CPT_OP_CIPHER_ENCRYPT | CPT_OP_AUTH_GENERATE)
+#define CPT_OP_DECODE  (CPT_OP_CIPHER_DECRYPT | CPT_OP_AUTH_VERIFY)
+
 /* #define CPT_ALWAYS_USE_SG_MODE */
 #define CPT_ALWAYS_USE_SEPARATE_BUF
 
+typedef enum {
+       MD5_TYPE        = 1,
+       SHA1_TYPE       = 2,
+       SHA2_SHA224     = 3,
+       SHA2_SHA256     = 4,
+       SHA2_SHA384     = 5,
+       SHA2_SHA512     = 6,
+       GMAC_TYPE       = 7,
+       XCBC_TYPE       = 8,
+       SHA3_SHA224     = 10,
+       SHA3_SHA256     = 11,
+       SHA3_SHA384     = 12,
+       SHA3_SHA512     = 13,
+       SHA3_SHAKE256   = 14,
+       SHA3_SHAKE512   = 15,
+
+       /* These are only for software use */
+       ZUC_EIA3        = 0x90,
+       SNOW3G_UIA2     = 0x91,
+       KASUMI_F9_CBC   = 0x92,
+       KASUMI_F9_ECB   = 0x93,
+} mc_hash_type_t;
+
+typedef enum {
+       /* To support passthrough */
+       PASSTHROUGH  = 0x0,
+       /*
+        * These are defined by MC for Flexi crypto
+        * for field of 4 bits
+        */
+       DES3_CBC    = 0x1,
+       DES3_ECB    = 0x2,
+       AES_CBC     = 0x3,
+       AES_ECB     = 0x4,
+       AES_CFB     = 0x5,
+       AES_CTR     = 0x6,
+       AES_GCM     = 0x7,
+       AES_XTS     = 0x8,
+
+       /* These are only for software use */
+       ZUC_EEA3        = 0x90,
+       SNOW3G_UEA2     = 0x91,
+       KASUMI_F8_CBC   = 0x92,
+       KASUMI_F8_ECB   = 0x93,
+} mc_cipher_type_t;
+
+typedef enum {
+       AES_128_BIT = 0x1,
+       AES_192_BIT = 0x2,
+       AES_256_BIT = 0x3
+} mc_aes_type_t;
+
+
 typedef struct sglist_comp {
        union {
                uint64_t len;
@@ -152,6 +231,17 @@ struct cpt_ctx {
        uint8_t  auth_key[64];
 };
 
+typedef struct fc_params digest_params_t;
+
+/* Cipher Algorithms */
+typedef mc_cipher_type_t cipher_type_t;
+
+/* Auth Algorithms */
+typedef mc_hash_type_t auth_type_t;
+
 #define CPT_P_ENC_CTRL(fctx)  fctx->enc.enc_ctrl.e
 
+#define SESS_PRIV(__sess) \
+       (void *)((uint8_t *)__sess + sizeof(struct cpt_sess_misc))
+
 #endif /* _CPT_MCODE_DEFINES_H_ */