Commit 0e93708d authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu

crypto: chcr - Add fallback for AEAD algos

Fallback to sw when
    I AAD length greater than 511
    II Zero length payload
    II No of sg entries exceeds Request size.
Signed-off-by: default avatarHarsh Jain <harsh@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 72a56ca9
This diff is collapsed.
......@@ -218,6 +218,10 @@
#define MAX_NK 8
#define CRYPTO_MAX_IMM_TX_PKT_LEN 256
#define MAX_WR_SIZE 512
#define MIN_AUTH_SG 2 /*IV + AAD*/
#define MIN_GCM_SG 2 /* IV + AAD*/
#define MIN_CCM_SG 3 /*IV+AAD+B0*/
struct algo_param {
unsigned int auth_mode;
......
......@@ -41,7 +41,7 @@
#define CCM_B0_SIZE 16
#define CCM_AAD_FIELD_SIZE 2
#define T5_MAX_AAD_SIZE 512
#define T6_MAX_AAD_SIZE 511
/* Define following if h/w is not dropping the AAD and IV data before
......@@ -188,6 +188,7 @@ struct chcr_aead_ctx {
__be32 key_ctx_hdr;
unsigned int enckey_len;
struct crypto_skcipher *null;
struct crypto_aead *sw_cipher;
u8 salt[MAX_SALT];
u8 key[CHCR_AES_MAX_KEY_LEN];
u16 hmac_ctrl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment