Commit 1f479e4c authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu

crypto: chelsio - Swap location of AAD and IV sent in WR

Send input as IV | AAD | Data. It will allow sending IV as Immediate
Data and Creates space in Work request to add more dma mapped entries.
Signed-off-by: default avatarHarsh Jain <harsh@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 3cc04c16
This diff is collapsed.
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
#define MIN_AUTH_SG 1 /* IV */ #define MIN_AUTH_SG 1 /* IV */
#define MIN_GCM_SG 1 /* IV */ #define MIN_GCM_SG 1 /* IV */
#define MIN_DIGEST_SG 1 /*Partial Buffer*/ #define MIN_DIGEST_SG 1 /*Partial Buffer*/
#define MIN_CCM_SG 2 /*IV+B0*/ #define MIN_CCM_SG 1 /*IV+B0*/
#define CIP_SPACE_LEFT(len) \ #define CIP_SPACE_LEFT(len) \
((SGE_MAX_WR_LEN - CIP_WR_MIN_LEN - (len))) ((SGE_MAX_WR_LEN - CIP_WR_MIN_LEN - (len)))
#define HASH_SPACE_LEFT(len) \ #define HASH_SPACE_LEFT(len) \
......
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
#define CCM_B0_SIZE 16 #define CCM_B0_SIZE 16
#define CCM_AAD_FIELD_SIZE 2 #define CCM_AAD_FIELD_SIZE 2
#define T6_MAX_AAD_SIZE 511 // 511 - 16(For IV)
#define T6_MAX_AAD_SIZE 495
/* Define following if h/w is not dropping the AAD and IV data before /* Define following if h/w is not dropping the AAD and IV data before
...@@ -185,9 +186,6 @@ struct chcr_aead_reqctx { ...@@ -185,9 +186,6 @@ struct chcr_aead_reqctx {
dma_addr_t b0_dma; dma_addr_t b0_dma;
unsigned int b0_len; unsigned int b0_len;
unsigned int op; unsigned int op;
short int aad_nents;
short int src_nents;
short int dst_nents;
u16 imm; u16 imm;
u16 verify; u16 verify;
u8 iv[CHCR_MAX_CRYPTO_IV_LEN + MAX_SCRATCH_PAD_SIZE]; u8 iv[CHCR_MAX_CRYPTO_IV_LEN + MAX_SCRATCH_PAD_SIZE];
...@@ -322,10 +320,8 @@ void chcr_aead_dma_unmap(struct device *dev, struct aead_request *req, ...@@ -322,10 +320,8 @@ void chcr_aead_dma_unmap(struct device *dev, struct aead_request *req,
unsigned short op_type); unsigned short op_type);
void chcr_add_aead_dst_ent(struct aead_request *req, void chcr_add_aead_dst_ent(struct aead_request *req,
struct cpl_rx_phys_dsgl *phys_cpl, struct cpl_rx_phys_dsgl *phys_cpl,
unsigned int assoclen,
unsigned short qid); unsigned short qid);
void chcr_add_aead_src_ent(struct aead_request *req, struct ulptx_sgl *ulptx, void chcr_add_aead_src_ent(struct aead_request *req, struct ulptx_sgl *ulptx);
unsigned int assoclen);
void chcr_add_cipher_src_ent(struct ablkcipher_request *req, void chcr_add_cipher_src_ent(struct ablkcipher_request *req,
void *ulptx, void *ulptx,
struct cipher_wr_param *wrparam); struct cipher_wr_param *wrparam);
......
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