Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Macros | Typedefs
STACK_SECURITY_API

Data Structures

struct  secAes_t
 AES Security callback parameters structure. More...
 
struct  secCmacMsg_t
 CMAC Security callback parameters structure. More...
 
struct  secCcmEncMsg_t
 CCM-Mode encrypt callback parameters structure. More...
 
struct  secCcmDecMsg_t
 CCM-Mode decrypt and authenticate callback parameters structure. More...
 
union  secMsg_t
 Generic 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. More...
 
#define SEC_AES_BLK_LEN   16
 CMAC algorithm key length. More...
 
#define SEC_CMAC_HASH_LEN   16
 CMAC algorithm result length. More...
 
#define SEC_ECC_KEY_LEN   32
 ECC algorithm key length. More...
 
#define SEC_TOKEN_INVALID   0xFF
 Invalid AES Token. More...
 

Typedefs

typedef void(* SecBlkEncFunc_t) (uint8_t *pKey, uint8_t *pMessage, void *pParam)
 Block encryption function. More...
 

CCM-Mode algorithm lengths

#define SEC_CCM_KEY_LEN   16
 
#define SEC_CCM_MAX_ADDITIONAL_LEN   ((1<<16) - (1<<8))
 
#define SEC_CCM_L   2
 
#define SEC_CCM_NONCE_LEN   (15-SEC_CCM_L)
 

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 SecAesRevInit (void)
 Initialize the AES (reverse) 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 SecCcmInit (void)
 Called to initialize CCM security. More...
 
void SecEccInit (void)
 Called to initialize ECC security. This function should only be called once upon system initialization. More...
 

Security AES, CMAC and CCM 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...
 
uint8_t SecAesRev (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. Note this version reverses the key and plaintext bytes. More...
 
bool_t SecCmac (const uint8_t *pKey, uint8_t *pPlaintext, uint16_t textLen, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Execute the CMAC algorithm. More...
 
bool_t SecCcmEnc (const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen, uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Execute the CCM-Mode encryption algorithm. More...
 
bool_t SecCcmDec (const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen, uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen, uint8_t *pResult, wsfHandlerId_t handlerId, uint16_t param, uint8_t event)
 Execute the CCM-Mode verify and decrypt 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...
 

Detailed Description

Macro Definition Documentation

#define SEC_AES_BLK_LEN   16

CMAC algorithm key length.

Definition at line 44 of file sec_api.h.

#define SEC_CMAC_HASH_LEN   16

CMAC algorithm result length.

Definition at line 47 of file sec_api.h.

#define SEC_CMAC_KEY_LEN   16

CMAC algorithm key length.

Definition at line 41 of file sec_api.h.

#define SEC_ECC_KEY_LEN   32

ECC algorithm key length.

Definition at line 50 of file sec_api.h.

#define SEC_TOKEN_INVALID   0xFF

Invalid AES Token.

Definition at line 63 of file sec_api.h.

Typedef Documentation

typedef void(* SecBlkEncFunc_t) (uint8_t *pKey, uint8_t *pMessage, void *pParam)

Block encryption function.

Definition at line 140 of file sec_api.h.

Function Documentation

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.
void SecAesInit ( void  )

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

Returns
None.
uint8_t SecAesRev ( 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. Note this version reverses the key and plaintext bytes.

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.
void SecAesRevInit ( void  )

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

Returns
None.
bool_t SecCcmDec ( const uint8_t *  pKey,
uint8_t *  pNonce,
uint8_t *  pCypherText,
uint16_t  textLen,
uint8_t *  pClear,
uint16_t  clearLen,
uint8_t *  pMic,
uint8_t  micLen,
uint8_t *  pResult,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Execute the CCM-Mode verify and decrypt algorithm.

Parameters
pKeyPointer to encryption key (SEC_CCM_KEY_LEN bytes).
pNoncePointer to nonce (SEC_CCM_NONCE_LEN bytes).
pCypherTextPointer to text to decrypt.
textLenLength of pCypherText in bytes.
pClearPointer to additional, unencrypted authentication text.
clearLenLength of pClear in bytes.
pMicPointer to authentication digest.
micLenSize of MIC in bytes (4, 8 or 16).
pResultBuffer to hold result (returned in complete event).
handlerIdTask handler ID to receive complete event.
paramOptional parameter passed in complete event.
eventEvent ID of complete event.
Returns
TRUE if successful, else FALSE.
bool_t SecCcmEnc ( const uint8_t *  pKey,
uint8_t *  pNonce,
uint8_t *  pPlainText,
uint16_t  textLen,
uint8_t *  pClear,
uint16_t  clearLen,
uint8_t  micLen,
uint8_t *  pResult,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Execute the CCM-Mode encryption algorithm.

Parameters
pKeyPointer to encryption key (SEC_CCM_KEY_LEN bytes).
pNoncePointer to nonce (SEC_CCM_NONCE_LEN bytes).
pPlainTextPointer to text to encrypt.
textLenLength of pPlainText in bytes.
pClearPointer to additional, unencrypted authentication text.
clearLenLength of pClear in bytes.
micLenSize of MIC in bytes (4, 8 or 16).
pResultBuffer to hold result (returned in complete event).
handlerIdTask handler ID to receive complete event.
paramOptional parameter passed in complete event.
eventEvent ID of complete event.
Returns
TRUE if successful, else FALSE.
void SecCcmInit ( void  )

Called to initialize CCM security.

Returns
None.
bool_t SecCmac ( const uint8_t *  pKey,
uint8_t *  pPlaintext,
uint16_t  textLen,
wsfHandlerId_t  handlerId,
uint16_t  param,
uint8_t  event 
)

Execute the CMAC algorithm.

Parameters
pKeyKey used in CMAC operation.
pPlaintextPlain text buffer - buffer must persist until secCmacMsg_t callback.
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.
void SecCmacInit ( void  )

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

Returns
None.
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 SecEccInit ( void  )

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

Returns
None.
void SecInit ( void  )

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

Returns
None.
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.
void SecRandInit ( void  )

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

Returns
None.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.