ISVP-SDK  3.12.0
Ingenic Smart Video Platform SDK
Data Structures | Macros | Typedefs | Enumerations | Functions
Sysutils_Cipher

Encryption and Decryption manage. More...

Collaboration diagram for Sysutils_Cipher:

Data Structures

struct  IN_UNF_CIPHER_CTRL_S
 Select the encryption process control structure. More...
 

Macros

#define REINIT   -10
 Error Code. More...
 
#define INIT_FAILED   -11
 Initializatie failed.
 
#define FAILED_GETHANDLE   -12
 Get handle failed.
 
#define INVALID_PARA   -13
 Invalid parameter.
 
#define SET_PARA_FAILED   -14
 Set parameters fail.
 
#define FAILURE   -15
 Operate failure.
 
#define SET_DATALEN_ERR   -16
 Set data length error.
 
#define EXIT_ERR   -17
 Module exit error.
 
#define UNINIT   -18
 Module not initialization.
 
#define FAILED_DESHANDLE   -19
 Destroy handle failed.
 

Typedefs

typedef enum IN_UNF_CIPHER_ALG_E IN_UNF_CIPHER_ALG
 Select an encryption algorithm. More...
 
typedef enum IN_UNF_CIPHER_WORK_MODE_E IN_UNF_CIPHER_WORK_MODE
 Select the encryption mode. More...
 
typedef enum IN_UNF_CIPHER_KEY_LENGTH_E IN_UNF_CIPHER_KEY_LENGTH
 Select the encryption key length used. More...
 
typedef enum IN_UNF_CIPHER_BIT_WIDTH_E IN_UNF_CIPHER_BIT_WIDTH
 Select the data length of encryption algorithm at a process. More...
 
typedef struct IN_UNF_CIPHER_CTRL_S IN_UNF_CIPHER_CTRL
 Select the encryption process control structure.
 

Enumerations

enum  IN_UNF_CIPHER_ALG_E { IN_UNF_CIPHER_ALG_AES = 0x0, IN_UNF_CIPHER_ALG_DES = 0x1 }
 Select an encryption algorithm. More...
 
enum  IN_UNF_CIPHER_WORK_MODE_E { IN_UNF_CIPHER_WORK_MODE_ECB = 0x0, IN_UNF_CIPHER_WORK_MODE_CBC = 0x1, IN_UNF_CIPHER_WORK_MODE_OTHER = 0x2 }
 Select the encryption mode. More...
 
enum  IN_UNF_CIPHER_KEY_LENGTH_E { IN_UNF_CIPHER_KEY_AES_128BIT = 0x0 }
 Select the encryption key length used. More...
 
enum  IN_UNF_CIPHER_BIT_WIDTH_E { IN_UNF_CIPHER_BIT_WIDTH_128BIT = 0x0 }
 Select the data length of encryption algorithm at a process. More...
 

Functions

int SU_CIPHER_Init (void)
 Open encryption module. More...
 
int SU_CIPHER_Exit (void)
 Close encryption module. More...
 
int SU_CIPHER_CreateHandle (void)
 Get a encryption module handle. More...
 
int SU_CIPHER_DestroyHandle (int fd)
 Destroy a encryption module handle. More...
 
int SU_CIPHER_ConfigHandle (int hCipher, IN_UNF_CIPHER_CTRL *Ctrl)
 Config encryption module. More...
 
int SU_CIPHER_Encrypt (int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
 Start encrypt data. More...
 
int SU_CIPHER_Decrypt (int hCipher, unsigned int *srcAddr, unsigned int *dstAddr, unsigned int dataLen)
 Start decrypt data. More...
 

Detailed Description

Encryption and Decryption manage.

Macro Definition Documentation

#define REINIT   -10

Error Code.

Repeat initialization

Typedef Documentation

Select an encryption algorithm.

Remarks
It supports two encryption algorithms AES and DES.

Select the data length of encryption algorithm at a process.

Remarks
By hardware limitations, at this stage only supports 128 bit KEY length.

Select the encryption key length used.

Remarks
By hardware limitations, at this stage only supports 128 bit KEY length.

Select the encryption mode.

Remarks
It supports two encryption modes AES and DES.

Enumeration Type Documentation

Select an encryption algorithm.

Remarks
It supports two encryption algorithms AES and DES.

Select the data length of encryption algorithm at a process.

Remarks
By hardware limitations, at this stage only supports 128 bit KEY length.

Select the encryption key length used.

Remarks
By hardware limitations, at this stage only supports 128 bit KEY length.

Select the encryption mode.

Remarks
It supports two encryption modes AES and DES.

Function Documentation

int SU_CIPHER_ConfigHandle ( int  hCipher,
IN_UNF_CIPHER_CTRL Ctrl 
)

Config encryption module.

Parameters
[in]hCipherThe handle need to be configed.
[in]CtrlConfiguration information structure.
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
None.
int SU_CIPHER_CreateHandle ( void  )

Get a encryption module handle.

Parameters
None.
Return values
successReturn the handle.
Failureretval < 0.
Remarks
None.
Attention
This function can be called multiple times, once for each call will return a handle. If this function called N times,then N times SU_CIPHER_DestroyHandle() called should be to do to destroy all handles we have got.
int SU_CIPHER_Decrypt ( int  hCipher,
unsigned int *  srcAddr,
unsigned int *  dstAddr,
unsigned int  dataLen 
)

Start decrypt data.

Parameters
[in]hCipherHandle to be operated..
[in]srcAddrSource address of required decrypted data.
[in]dstAddrTarget address to store decrypted data.
[in]dataLenData length needed to be processed..
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
Decrypted data length dataLen maximum not more than 1Mbyte (1024*1024).
int SU_CIPHER_DestroyHandle ( int  fd)

Destroy a encryption module handle.

Parameters
[in]fdHandle need to be destroy
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
This function can be called multiple times, each call will destroy one handle.
int SU_CIPHER_Encrypt ( int  hCipher,
unsigned int *  srcAddr,
unsigned int *  dstAddr,
unsigned int  dataLen 
)

Start encrypt data.

Parameters
[in]hCipherHandle to be operated..
[in]srcAddrSource address of required encrypted data.
[in]dstAddrTarget address to store encrypted data.
[in]dataLenData length needed to be processed..
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
Encrypted data length dataLen maximum not more than 1Mbyte (1024*1024).
int SU_CIPHER_Exit ( void  )

Close encryption module.

Parameters
None.
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
None.
int SU_CIPHER_Init ( void  )

Open encryption module.

Parameters
None.
Return values
0Success.
Non-0Failure.
Remarks
None.
Attention
None.