Cordio Stack and Cordio Profiles  r2p3-02rel0

Data Structures

struct  secMsg_t
 AES Security callback parameters structure. More...
 
struct  secEccKey_t
 ECC Security public/private key pair. More...
 
struct  secEccSharedSec_t
 ECC security DH Key shared secret. More...
 
struct  secEccMsg_t
 ECC Security callback parameters structure. More...
 

Macros

#define SEC_CMAC_KEY_LEN   16
 CMAC algorithm key length.
 
#define SEC_CMAC_HASH_LEN   16
 CMAC algorithm result length.
 
#define SEC_ECC_KEY_LEN   32
 ECC algorithm key length.
 
#define SEC_TOKEN_INVALID   0xFF
 Invalid AES Token.
 

Typedefs

typedef secMsg_t secAes_t
 AES Security callback are the same as secMsg_t.
 
typedef secMsg_t secCmacMsg_t
 CMAC Security callback are the same as secMsg_t.
 

Security Initialization Functions

void SecInit (void)
 Initialize the security service. This function should only be called once upon system initialization. More...
 
void SecRandInit (void)
 Initialize the random number service. This function should only be called once upon system initialization. More...
 
void SecAesInit (void)
 Initialize the AES service. This function should only be called once upon system initialization. More...
 
void SecCmacInit (void)
 Called to initialize CMAC security. This function should only be called once upon system initialization. More...
 
void SecEccInit (void)
 Called to initialize ECC security. This function should only be called once upon system initialization. More...
 

Security AES and CMAC Functions

uint8_t SecAes (uint8_t *pKey, uint8_t *pPlaintext, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Execute an AES calculation. When the calculation completes, a WSF message will be sent to the specified handler. This function returns a token value that the client can use to match calls to this function with messages. More...
 
bool_t SecCmac (const uint8_t *pKey, uint8_t *pPlaintext, uint8_t textLen, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Execute the CMAC algorithm. More...
 

Security ECC Functions

bool_t SecEccGenKey (wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Generate an ECC key. More...
 
bool_t SecEccGenSharedSecret (secEccKey_t *pKey, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Generate an ECC key. More...
 

Security Random Number Generator Functions

void SecRand (uint8_t *pRand, uint8_t randLen)
 This function returns up to 16 bytes of random data to a buffer provided by the client. More...
 

Description

Function Documentation

void SecInit ( void  )

Initialize the security service. This function should only be called once upon system initialization.

Returns
None.
void SecRandInit ( void  )

Initialize the random number service. This function should only be called once upon system initialization.

Returns
None.
void SecAesInit ( void  )

Initialize the AES service. This function should only be called once upon system initialization.

Returns
None.
void SecCmacInit ( void  )

Called to initialize CMAC security. This function should only be called once upon system initialization.

Returns
None.
void SecEccInit ( void  )

Called to initialize ECC security. This function should only be called once upon system initialization.

Returns
None.
uint8_t SecAes ( uint8_t pKey,
uint8_t pPlaintext,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Execute an AES calculation. When the calculation completes, a WSF message will be sent to the specified handler. This function returns a token value that the client can use to match calls to this function with messages.

Parameters
pKeyPointer to 16 byte key.
pPlaintextPointer to 16 byte plaintext.
handlerIdWSF handler ID.
paramClient-defined parameter returned in message.
eventEvent for client's WSF handler.
Returns
Token value.
bool_t SecCmac ( const uint8_t pKey,
uint8_t pPlaintext,
uint8_t  textLen,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Execute the CMAC algorithm.

Parameters
pKeyKey used in CMAC operation.
pPlaintextData to perform CMAC operation over
textLenSize of pPlaintext in bytes.
handlerIdWSF handler ID for client.
paramOptional parameter sent to client's WSF handler.
eventEvent for client's WSF handler.
Returns
TRUE if successful, else FALSE.
bool_t SecEccGenKey ( wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Generate an ECC key.

Parameters
handlerIdWSF handler ID for client.
paramOptional parameter sent to client's WSF handler.
eventEvent for client's WSF handler.
Returns
TRUE if successful, else FALSE.
bool_t SecEccGenSharedSecret ( secEccKey_t pKey,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Generate an ECC key.

Parameters
pKeyECC Key structure.
handlerIdWSF handler ID for client.
paramOptional parameter sent to client's WSF handler.
eventEvent for client's WSF handler.
Returns
TRUE if successful, else FALSE.
void SecRand ( uint8_t pRand,
uint8_t  randLen 
)

This function returns up to 16 bytes of random data to a buffer provided by the client.

Parameters
pRandPointer to returned random data.
randLenLength of random data.
Returns
None.