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 HeaderBy tes;
unsigned long inBytes;
unsigned char *inData;
unsigned long ROCBytes ;
unsigned long cryptDat aBytes;
unsigned char *cryptDat aOut;
unsigned long digestBy tes;
unsigned char *digestDa ta;
unsigned long outIvByt es;
unsigned char *outIvDat a;
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 d esencReq;
...
/* fill the User Request structure with appropriate pointers */
desencReq.opId = DPD_TDES_CB C_ENCRYPT_SA_LDCTX_CRYP T ;
desencReq.channel = 0; /* dynami c channel */
desencReq.notify = (voi d*) notifyDes; /* callba ck function */
desencReq.notify_on_err or = (void*) notifyDes; /* callbac k 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