Commit c16a70c1 authored by Kai Ye's avatar Kai Ye Committed by Herbert Xu

crypto: hisilicon/sec - add new algorithm mode for AEAD

Add new algorithm mode for AEAD:
CCM(AES), GCM(AES), CCM(SM4), GCM(SM4).
Signed-off-by: default avatarKai Ye <yekai13@huawei.com>
Signed-off-by: default avatarLongfang Liu <liulongfang@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1b82435d
...@@ -13,6 +13,8 @@ struct sec_alg_res { ...@@ -13,6 +13,8 @@ struct sec_alg_res {
dma_addr_t pbuf_dma; dma_addr_t pbuf_dma;
u8 *c_ivin; u8 *c_ivin;
dma_addr_t c_ivin_dma; dma_addr_t c_ivin_dma;
u8 *a_ivin;
dma_addr_t a_ivin_dma;
u8 *out_mac; u8 *out_mac;
dma_addr_t out_mac_dma; dma_addr_t out_mac_dma;
}; };
...@@ -33,6 +35,8 @@ struct sec_cipher_req { ...@@ -33,6 +35,8 @@ struct sec_cipher_req {
struct sec_aead_req { struct sec_aead_req {
u8 *out_mac; u8 *out_mac;
dma_addr_t out_mac_dma; dma_addr_t out_mac_dma;
u8 *a_ivin;
dma_addr_t a_ivin_dma;
struct aead_request *aead_req; struct aead_request *aead_req;
}; };
......
This diff is collapsed.
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#ifndef __HISI_SEC_V2_CRYPTO_H #ifndef __HISI_SEC_V2_CRYPTO_H
#define __HISI_SEC_V2_CRYPTO_H #define __HISI_SEC_V2_CRYPTO_H
#define SEC_AIV_SIZE 12
#define SEC_IV_SIZE 24 #define SEC_IV_SIZE 24
#define SEC_MAX_KEY_SIZE 64 #define SEC_MAX_KEY_SIZE 64
#define SEC_COMM_SCENE 0 #define SEC_COMM_SCENE 0
...@@ -22,6 +23,11 @@ enum sec_hash_alg { ...@@ -22,6 +23,11 @@ enum sec_hash_alg {
}; };
enum sec_mac_len { enum sec_mac_len {
SEC_HMAC_CCM_MAC = 16,
SEC_HMAC_GCM_MAC = 16,
SEC_SM3_MAC = 32,
SEC_HMAC_SM3_MAC = 32,
SEC_HMAC_MD5_MAC = 16,
SEC_HMAC_SHA1_MAC = 20, SEC_HMAC_SHA1_MAC = 20,
SEC_HMAC_SHA256_MAC = 32, SEC_HMAC_SHA256_MAC = 32,
SEC_HMAC_SHA512_MAC = 64, SEC_HMAC_SHA512_MAC = 64,
...@@ -33,6 +39,8 @@ enum sec_cmode { ...@@ -33,6 +39,8 @@ enum sec_cmode {
SEC_CMODE_CFB = 0x2, SEC_CMODE_CFB = 0x2,
SEC_CMODE_OFB = 0x3, SEC_CMODE_OFB = 0x3,
SEC_CMODE_CTR = 0x4, SEC_CMODE_CTR = 0x4,
SEC_CMODE_CCM = 0x5,
SEC_CMODE_GCM = 0x6,
SEC_CMODE_XTS = 0x7, SEC_CMODE_XTS = 0x7,
}; };
......
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