Commit 8a3719a5 authored by Nagadheeraj Rottela's avatar Nagadheeraj Rottela Committed by Herbert Xu

crypto: cavium/nitrox - Added rfc4106(gcm(aes)) cipher support

Added rfc4106(gcm(aes)) cipher.
Signed-off-by: default avatarNagadheeraj Rottela <rnagadheeraj@marvell.com>
Reviewed-by: default avatarSrikanth Jampala <jsrikanth@marvell.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 33d69455
This diff is collapsed.
...@@ -211,6 +211,50 @@ struct nitrox_kcrypt_request { ...@@ -211,6 +211,50 @@ struct nitrox_kcrypt_request {
u8 *dst; u8 *dst;
}; };
/**
* struct nitrox_aead_rctx - AEAD request context
* @nkreq: Base request context
* @cryptlen: Encryption/Decryption data length
* @assoclen: AAD length
* @srclen: Input buffer length
* @dstlen: Output buffer length
* @iv: IV data
* @ivsize: IV data length
* @flags: AEAD req flags
* @ctx_handle: Device context handle
* @src: Source sglist
* @dst: Destination sglist
* @ctrl_arg: Identifies the request type (ENCRYPT/DECRYPT)
*/
struct nitrox_aead_rctx {
struct nitrox_kcrypt_request nkreq;
unsigned int cryptlen;
unsigned int assoclen;
unsigned int srclen;
unsigned int dstlen;
u8 *iv;
int ivsize;
u32 flags;
u64 ctx_handle;
struct scatterlist *src;
struct scatterlist *dst;
u8 ctrl_arg;
};
/**
* struct nitrox_rfc4106_rctx - rfc4106 cipher request context
* @base: AEAD request context
* @src: Source sglist
* @dst: Destination sglist
* @assoc: AAD
*/
struct nitrox_rfc4106_rctx {
struct nitrox_aead_rctx base;
struct scatterlist src[3];
struct scatterlist dst[3];
u8 assoc[20];
};
/** /**
* struct pkt_instr_hdr - Packet Instruction Header * struct pkt_instr_hdr - Packet Instruction Header
* @g: Gather used * @g: Gather used
...@@ -512,7 +556,7 @@ static inline struct scatterlist *create_multi_sg(struct scatterlist *to_sg, ...@@ -512,7 +556,7 @@ static inline struct scatterlist *create_multi_sg(struct scatterlist *to_sg,
struct scatterlist *sg = to_sg; struct scatterlist *sg = to_sg;
unsigned int sglen; unsigned int sglen;
for (; buflen; buflen -= sglen) { for (; buflen && from_sg; buflen -= sglen) {
sglen = from_sg->length; sglen = from_sg->length;
if (sglen > buflen) if (sglen > buflen)
sglen = buflen; sglen = buflen;
......
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