7 #ifndef __SU_CIPHER_H__
8 #define __SU_CIPHER_H__
35 IN_UNF_CIPHER_ALG_AES = 0x0,
36 IN_UNF_CIPHER_ALG_DES = 0x1
45 IN_UNF_CIPHER_WORK_MODE_ECB = 0x0,
46 IN_UNF_CIPHER_WORK_MODE_CBC = 0x1,
47 IN_UNF_CIPHER_WORK_MODE_OTHER = 0x2
56 IN_UNF_CIPHER_KEY_AES_128BIT = 0x0,
65 IN_UNF_CIPHER_BIT_WIDTH_128BIT = 0x0,
186 int SU_CIPHER_Encrypt(
int hCipher,
unsigned int * srcAddr,
unsigned int * dstAddr,
unsigned int dataLen);
206 int SU_CIPHER_Decrypt(
int hCipher,
unsigned int * srcAddr,
unsigned int * dstAddr,
unsigned int dataLen);
212 #define INIT_FAILED -11
213 #define FAILED_GETHANDLE -12
214 #define INVALID_PARA -13
215 #define SET_PARA_FAILED -14
217 #define SET_DATALEN_ERR -16
220 #define FAILED_DESHANDLE -19
IN_UNF_CIPHER_ALG enAlg
处理数据使用的加密算法
Definition: su_cipher.h:76
int SU_CIPHER_Init(void)
加密模块打开接口.
enum IN_UNF_CIPHER_WORK_MODE_E IN_UNF_CIPHER_WORK_MODE
选择加密模式.
enum IN_UNF_CIPHER_ALG_E IN_UNF_CIPHER_ALG
选择加密算法.
unsigned int IV[4]
加密时使用的IV向量
Definition: su_cipher.h:74
unsigned int key[4]
加密时使用的密钥
Definition: su_cipher.h:73
选择加密处理控制结构体.
Definition: su_cipher.h:71
int SU_CIPHER_Exit(void)
加密模块关闭接口.
IN_UNF_CIPHER_BIT_WIDTH_E
选择加密算法一次处理的数据长度.
Definition: su_cipher.h:63
int SU_CIPHER_DestroyHandle(int fd)
销毁加密模块句柄.
IN_UNF_CIPHER_ALG_E
选择加密算法.
Definition: su_cipher.h:33
enum IN_UNF_CIPHER_KEY_LENGTH_E IN_UNF_CIPHER_KEY_LENGTH
选择加密使用的密钥长度.
struct IN_UNF_CIPHER_CTRL_S IN_UNF_CIPHER_CTRL
选择加密处理控制结构体.
IN_UNF_CIPHER_WORK_MODE enWorkMode
处理数据使用的加密算法的模式
Definition: su_cipher.h:78
int SU_CIPHER_Decrypt(int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
开始进行数据的解密.
IN_UNF_CIPHER_KEY_LENGTH_E
选择加密使用的密钥长度.
Definition: su_cipher.h:54
IN_UNF_CIPHER_WORK_MODE_E
选择加密模式.
Definition: su_cipher.h:43
int SU_CIPHER_ConfigHandle(int hCipher, IN_UNF_CIPHER_CTRL *Ctrl)
对加密模块进行配置.
unsigned int enDataLen
需要处理的数据总长度
Definition: su_cipher.h:75
enum IN_UNF_CIPHER_BIT_WIDTH_E IN_UNF_CIPHER_BIT_WIDTH
选择加密算法一次处理的数据长度.
IN_UNF_CIPHER_KEY_LENGTH enKeyLen
加密算法使用的KEY的长度
Definition: su_cipher.h:79
int SU_CIPHER_Encrypt(int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
开始进行数据的加密.
int SU_CIPHER_CreateHandle(void)
获得加密模块句柄接口.
IN_UNF_CIPHER_BIT_WIDTH enBitWidth
加密算法一次处理的数据长度
Definition: su_cipher.h:77