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
Encryption algorithm used in processing data.
Definition: su_cipher.h:76
int SU_CIPHER_Init(void)
Open encryption module.
enum IN_UNF_CIPHER_WORK_MODE_E IN_UNF_CIPHER_WORK_MODE
Select the encryption mode.
enum IN_UNF_CIPHER_ALG_E IN_UNF_CIPHER_ALG
Select an encryption algorithm.
unsigned int IV[4]
IV Vector used in a encryption.
Definition: su_cipher.h:74
unsigned int key[4]
KEY used in a encryption.
Definition: su_cipher.h:73
Select the encryption process control structure.
Definition: su_cipher.h:71
int SU_CIPHER_Exit(void)
Close encryption module.
IN_UNF_CIPHER_BIT_WIDTH_E
Select the data length of encryption algorithm at a process.
Definition: su_cipher.h:63
int SU_CIPHER_DestroyHandle(int fd)
Destroy a encryption module handle.
IN_UNF_CIPHER_ALG_E
Select an encryption algorithm.
Definition: su_cipher.h:33
enum IN_UNF_CIPHER_KEY_LENGTH_E IN_UNF_CIPHER_KEY_LENGTH
Select the encryption key length used.
struct IN_UNF_CIPHER_CTRL_S IN_UNF_CIPHER_CTRL
Select the encryption process control structure.
IN_UNF_CIPHER_WORK_MODE enWorkMode
Encryption algorithm mode used to process data.
Definition: su_cipher.h:78
int SU_CIPHER_Decrypt(int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
Start decrypt data.
IN_UNF_CIPHER_KEY_LENGTH_E
Select the encryption key length used.
Definition: su_cipher.h:54
IN_UNF_CIPHER_WORK_MODE_E
Select the encryption mode.
Definition: su_cipher.h:43
int SU_CIPHER_ConfigHandle(int hCipher, IN_UNF_CIPHER_CTRL *Ctrl)
Config encryption module.
unsigned int enDataLen
Total length of data to be processed.
Definition: su_cipher.h:75
enum IN_UNF_CIPHER_BIT_WIDTH_E IN_UNF_CIPHER_BIT_WIDTH
Select the data length of encryption algorithm at a process.
IN_UNF_CIPHER_KEY_LENGTH enKeyLen
KEY length of the encryption algorithm.
Definition: su_cipher.h:79
int SU_CIPHER_Encrypt(int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
Start encrypt data.
int SU_CIPHER_CreateHandle(void)
Get a encryption module handle.
IN_UNF_CIPHER_BIT_WIDTH enBitWidth
Data length of Encryption algorithm in once process.
Definition: su_cipher.h:77