SEC 2.0 Reference Device Driver User's Guide
Table Of Contents
- SEC 2.0 Reference Device Driver User’s Guide
- 1 Overview
- 2 Device Driver Components
- 3 User Interface
- 4 Individual Request Type Descriptions
- 4.1 Random Number Requests
- 4.2 DES Requests
- 4.3 ARC4 Requests
- 4.4 Hash Requests
- 4.5 HMAC Requests
- 4.6 AES Requests
- 4.7 Integer Public Key Requests
- 4.8 ECC Public Key Requests
- 4.9 IPSec Requests
- 4.10 802.11 Protocol Requests
- 4.11 SRTP Protocol Requests
- 5 Sample Code
- 6 Linux Environment
- 7 VxWorks Environment
- 8 Porting

SEC 2.0 Reference Device Driver User’s Guide, Rev. 0
36 PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE Freescale Semiconductor
Sample Code
unsigned long ivBytes;
unsigned char *ivData;
unsigned long HeaderBytes;
unsigned long inBytes;
unsigned char *inData;
unsigned long ROCBytes;
unsigned long cryptDataBytes;
unsigned char *cryptDataOut;
unsigned long digestBytes;
unsigned char *digestData;
unsigned long outIvBytes;
unsigned char *outIvData;
NUM_SRTP_DESC defines the number of descriptors within the DPD_SRTP_GROUP that use this request.
DPD_SRTP_GROUP (0x8500) defines the group for all descriptors within this request.
5 Sample Code
The following sections provide sample codes for DES and IPSec.
5.1 DES Sample
/* define the User Structure */
DES_LOADCTX_CRYPT_REQ desencReq;
...
/* fill the User Request structure with appropriate pointers */
desencReq.opId = DPD_TDES_CBC_ENCRYPT_SA_LDCTX_CRYPT ;
desencReq.channel = 0; /* dynamic channel */
desencReq.notify = (void*) notifyDes; /* callback function */
desencReq.notify_on_error = (void*) notifyDes; /* callback in case of
errors only */
Table 30 . SRTP_REQ Valid Descriptors (opId)
Descriptors Value Function Description
DPD_SRTP_OUTBOUND 0x8500 Process an outbound SRTP packet
DPD_SRTP_INBOUND 0x8501 Process an inbound SRTP packet