Commit ae4a825f authored by Horia Geanta's avatar Horia Geanta Committed by Herbert Xu

crypto: caam - add support for aead null encryption

Add support for the following combinations:
-encryption: null
-authentication: md5, sha* (1, 224, 256, 384, 512)
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@freescale.com>
Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent bca4feb0
This diff is collapsed.
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <net/xfrm.h> #include <net/xfrm.h>
#include <crypto/algapi.h> #include <crypto/algapi.h>
#include <crypto/null.h>
#include <crypto/aes.h> #include <crypto/aes.h>
#include <crypto/des.h> #include <crypto/des.h>
#include <crypto/sha.h> #include <crypto/sha.h>
......
...@@ -155,21 +155,29 @@ static inline void append_cmd_data(u32 *desc, void *data, int len, ...@@ -155,21 +155,29 @@ static inline void append_cmd_data(u32 *desc, void *data, int len,
append_data(desc, data, len); append_data(desc, data, len);
} }
static inline u32 *append_jump(u32 *desc, u32 options) #define APPEND_CMD_RET(cmd, op) \
{ static inline u32 *append_##cmd(u32 *desc, u32 options) \
u32 *cmd = desc_end(desc); { \
u32 *cmd = desc_end(desc); \
PRINT_POS; PRINT_POS; \
append_cmd(desc, CMD_JUMP | options); append_cmd(desc, CMD_##op | options); \
return cmd; \
return cmd;
} }
APPEND_CMD_RET(jump, JUMP)
APPEND_CMD_RET(move, MOVE)
static inline void set_jump_tgt_here(u32 *desc, u32 *jump_cmd) static inline void set_jump_tgt_here(u32 *desc, u32 *jump_cmd)
{ {
*jump_cmd = *jump_cmd | (desc_len(desc) - (jump_cmd - desc)); *jump_cmd = *jump_cmd | (desc_len(desc) - (jump_cmd - desc));
} }
static inline void set_move_tgt_here(u32 *desc, u32 *move_cmd)
{
*move_cmd &= ~MOVE_OFFSET_MASK;
*move_cmd = *move_cmd | ((desc_len(desc) << (MOVE_OFFSET_SHIFT + 2)) &
MOVE_OFFSET_MASK);
}
#define APPEND_CMD(cmd, op) \ #define APPEND_CMD(cmd, op) \
static inline void append_##cmd(u32 *desc, u32 options) \ static inline void append_##cmd(u32 *desc, u32 options) \
{ \ { \
...@@ -177,7 +185,6 @@ static inline void append_##cmd(u32 *desc, u32 options) \ ...@@ -177,7 +185,6 @@ static inline void append_##cmd(u32 *desc, u32 options) \
append_cmd(desc, CMD_##op | options); \ append_cmd(desc, CMD_##op | options); \
} }
APPEND_CMD(operation, OPERATION) APPEND_CMD(operation, OPERATION)
APPEND_CMD(move, MOVE)
#define APPEND_CMD_LEN(cmd, op) \ #define APPEND_CMD_LEN(cmd, op) \
static inline void append_##cmd(u32 *desc, unsigned int len, u32 options) \ static inline void append_##cmd(u32 *desc, unsigned int len, u32 options) \
...@@ -328,7 +335,7 @@ append_cmd(desc, CMD_MATH | MATH_FUN_##op | MATH_DEST_##dest | \ ...@@ -328,7 +335,7 @@ append_cmd(desc, CMD_MATH | MATH_FUN_##op | MATH_DEST_##dest | \
do { \ do { \
APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ); \ APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ); \
append_cmd(desc, data); \ append_cmd(desc, data); \
} while (0); } while (0)
#define append_math_add_imm_u32(desc, dest, src0, src1, data) \ #define append_math_add_imm_u32(desc, dest, src0, src1, data) \
APPEND_MATH_IMM_u32(ADD, desc, dest, src0, src1, data) APPEND_MATH_IMM_u32(ADD, desc, dest, src0, src1, data)
......
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