SEC 2.0 Reference Device Driver User’s Guide, Rev. 0
38 PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE Freescale Semiconductor
Sample Code
ipsecReq.hashKeyBytes = 16; /* key length for H MAC SHA-1 */
ipsecReq.hashKeyData = authK ey; /* pointer to HMAC Key */
ipsecReq.cryptCtxInByte s = 8; /* length of input iv */
ipsecReq.cryptCtxInData = in_iv; /* pointer to input iv */
ipsecReq.cryptKeyBytes = 24; /* DES key length */
ipsecReq.cryptKeyData = EncKey; /* pointer to D ES key */
ipsecReq.hashInDataByte s = 8; /* length of data to be hashed only */
ipsecReq.hashInData = P lainText; /* pointer to data to be
hashed only */
ipsecReq.inDataBytes = packe t_length-8; /* length of data to be
hashed and encrypted */
ipsecReq.inData = &Plai nText[8]; /* pointer to data to be
hashed and encrypted */
ipsecReq.cryptDataOut = Result; /* pointer to e ncrypted results */
ipsecReq.hashDataOutByt es = 20; /* length of output digest */
ipsecReq.hashDataOut = diges t; /* pointer to output digest */
ipsecReq.nextReq = 0; /* no chaine d requests */
/* call the driver */
status = Ioctl(device, IOCTL_PROC_REQ, &ipsecRe q);
/* First Level Error Checking */
if (status != 0) {
...
}
...
void notifyFunc (void)
{
/* Second Level Error Checking */
if (ipsecReq.status != 0) {
...
}
..)