SEC 2.0 Reference Device Driver User’s Guide, Rev. 0
Freescale Semiconductor PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE 37
Sample Code
desencReq.status = 0;
desencReq.ivBytes = 8; /* input iv length */
desencReq.ivData = iv_in; /* poi nter to input iv */
desencReq.keyBytes = 24; /* key le ngth */
desencReq.keyData = Des Key; /* pointer to key * /
desencReq.inBytes = pac ket_length; /* data leng th */
desencReq.inData = DesData; /* pointer to data */
desencReq.outData = des EncResult; /* pointer to results */
desencReq.nextReq = 0; /* no descriptor chained */
/* call the driver */
status = Ioctl(device, IOCTL_PROC_REQ, &desencR eq);
/* First Level Error Checking */
if (status != 0) {
..
}
...
void notifyDes (void)
{
/* Second Level Error Checking */
if (desencReq.status != 0) {
..
}
..)
5.2 IPSEC Sample
/* define User Requests structures */
IPSEC_CBC_REQ ipsecReq;
....
/* Ipsec dynamic descri ptor triple DES with SHA -1 authentication */
ipsecReq.opId = DPD_IPS EC_CBC_TDES_ENCRYPT_SHA_ PAD;
ipsecReq.channel = 0;
ipsecReq.notify = (void *) notifyFunc;
ipsecReq.notify_on_erro r = (void *) notifyFunc;
ipsecReq.status = 0;