Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Macros | Typedefs
sec_api.h File Reference

AES and random number security service API. More...

#include "wsf_types.h"

Go to the source code of this file.

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...
 
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)
 

Typedefs

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

Functions

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

AES and random number security service API.

Copyright (c) 2010-2019 Arm Ltd. All Rights Reserved.

Copyright (c) 2019-2020 Packetcraft, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file sec_api.h.

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.