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
38 PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE Freescale Semiconductor
Sample Code
ipsecReq.hashKeyBytes = 16; /* key length for HMAC SHA-1 */
ipsecReq.hashKeyData = authKey; /* pointer to HMAC Key */
ipsecReq.cryptCtxInBytes = 8; /* length of input iv */
ipsecReq.cryptCtxInData = in_iv; /* pointer to input iv */
ipsecReq.cryptKeyBytes = 24; /* DES key length */
ipsecReq.cryptKeyData = EncKey; /* pointer to DES key */
ipsecReq.hashInDataBytes = 8; /* length of data to be hashed only */
ipsecReq.hashInData = PlainText; /* pointer to data to be
hashed only */
ipsecReq.inDataBytes = packet_length-8; /* length of data to be
hashed and encrypted */
ipsecReq.inData = &PlainText[8]; /* pointer to data to be
hashed and encrypted */
ipsecReq.cryptDataOut = Result; /* pointer to encrypted results */
ipsecReq.hashDataOutBytes = 20; /* length of output digest */
ipsecReq.hashDataOut = digest; /* pointer to output digest */
ipsecReq.nextReq = 0; /* no chained requests */
/* call the driver */
status = Ioctl(device, IOCTL_PROC_REQ, &ipsecReq);
/* First Level Error Checking */
if (status != 0) {
...
}
...
void notifyFunc (void)
{
/* Second Level Error Checking */
if (ipsecReq.status != 0) {
...
}
..)