Data Structures | Macros | Enumerations
AESCommon.h File Reference

Detailed Description

AES common module header for all devices.


#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for AESCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AESCommon_Config
 AES Global configuration. More...
 

Macros

#define AES_STATUS_SUCCESS   ((int_fast16_t)0)
 Successful status code. More...
 
#define AES_STATUS_ERROR   ((int_fast16_t)-1)
 Generic error status code. More...
 
#define AES_STATUS_RESOURCE_UNAVAILABLE   ((int_fast16_t)-2)
 An error status code returned if the hardware or software resource is currently unavailable. More...
 
#define AES_STATUS_CANCELED   ((int_fast16_t)-3)
 The ongoing operation was canceled. More...
 
#define AES_STATUS_MAC_INVALID   ((int_fast16_t)-4)
 The MAC verification failed. More...
 
#define AES_STATUS_KEYSTORE_INVALID_ID   ((int_fast16_t)-5)
 The operation tried to load a key from the keystore using an invalid key ID. More...
 
#define AES_STATUS_KEYSTORE_GENERIC_ERROR   ((int_fast16_t)-6)
 The key store module returned a generic error. See key store documentation for additional details. More...
 
#define AES_STATUS_FEATURE_NOT_SUPPORTED   ((int_fast16_t)-7)
 The operation requested is not supported. More...
 
#define AES_STATUS_UNALIGNED_IO_NOT_SUPPORTED   ((int_fast16_t)-8)
 The operation does not support non-word-aligned input and/or output. More...
 
#define AES_STATUS_DRIVER_SPECIFIC_ERROR   ((int_fast16_t)-16)
 A driver shall use this error code and grow negatively until (AES_STATUS_RESERVED + 1) if more driver specific error codes are needed beyond the common codes listed above. More...
 
#define AES_STATUS_RESERVED   ((int_fast16_t)-32)
 

Enumerations

enum  AES_ReturnBehavior { AES_RETURN_BEHAVIOR_CALLBACK = 1, AES_RETURN_BEHAVIOR_BLOCKING = 2, AES_RETURN_BEHAVIOR_POLLING = 4 }
 The return behavior of AES functions. More...
 

Macro Definition Documentation

§ AES_STATUS_SUCCESS

#define AES_STATUS_SUCCESS   ((int_fast16_t)0)

Successful status code.

Functions return AES_STATUS_SUCCESS if the function was executed successfully.

§ AES_STATUS_ERROR

#define AES_STATUS_ERROR   ((int_fast16_t)-1)

Generic error status code.

Functions return AES_STATUS_ERROR if the function was not executed successfully and no more pertinent error code could be returned.

§ AES_STATUS_RESOURCE_UNAVAILABLE

#define AES_STATUS_RESOURCE_UNAVAILABLE   ((int_fast16_t)-2)

An error status code returned if the hardware or software resource is currently unavailable.

AES driver implementations may have hardware or software limitations on how many clients can simultaneously perform operations. This status code is returned if the mutual exclusion mechanism signals that an operation cannot currently be performed.

§ AES_STATUS_CANCELED

#define AES_STATUS_CANCELED   ((int_fast16_t)-3)

The ongoing operation was canceled.

§ AES_STATUS_MAC_INVALID

#define AES_STATUS_MAC_INVALID   ((int_fast16_t)-4)

The MAC verification failed.

Functions return AES_STATUS_MAC_INVALID if the MAC computed for the provided (key, message) pair did not match the MAC provided.

§ AES_STATUS_KEYSTORE_INVALID_ID

#define AES_STATUS_KEYSTORE_INVALID_ID   ((int_fast16_t)-5)

The operation tried to load a key from the keystore using an invalid key ID.

This code is returned if the provided CryptoKey reference is returned as invalid by the key store module.

§ AES_STATUS_KEYSTORE_GENERIC_ERROR

#define AES_STATUS_KEYSTORE_GENERIC_ERROR   ((int_fast16_t)-6)

The key store module returned a generic error. See key store documentation for additional details.

§ AES_STATUS_FEATURE_NOT_SUPPORTED

#define AES_STATUS_FEATURE_NOT_SUPPORTED   ((int_fast16_t)-7)

The operation requested is not supported.

§ AES_STATUS_UNALIGNED_IO_NOT_SUPPORTED

#define AES_STATUS_UNALIGNED_IO_NOT_SUPPORTED   ((int_fast16_t)-8)

The operation does not support non-word-aligned input and/or output.

§ AES_STATUS_DRIVER_SPECIFIC_ERROR

#define AES_STATUS_DRIVER_SPECIFIC_ERROR   ((int_fast16_t)-16)

A driver shall use this error code and grow negatively until (AES_STATUS_RESERVED + 1) if more driver specific error codes are needed beyond the common codes listed above.

Note
Not to be confused with AES_STATUS_RESERVED which is for defining device specific codes if needed for a given driver, while AES_STATUS_DRIVER_SPECIFIC_ERROR is for a driver but common across all devices for which that driver is implemented.

Example implementation specific status codes:

#define AESXYZ_STATUS_ERROR0 AES_STATUS_DRIVER_SPECIFIC_ERROR - 0
#define AESXYZ_STATUS_ERROR1 AES_STATUS_DRIVER_SPECIFIC_ERROR - 1
#define AESXYZ_STATUS_ERROR2 AES_STATUS_DRIVER_SPECIFIC_ERROR - 2

§ AES_STATUS_RESERVED

#define AES_STATUS_RESERVED   ((int_fast16_t)-32)

Common AES status code reservation offset. AES driver implementations should offset status codes with AES_STATUS_RESERVED growing negatively.

Example implementation specific status codes:

#define AESXYZCCXXXX_STATUS_ERROR0 AES_STATUS_RESERVED - 0
#define AESXYZCCXXXX_STATUS_ERROR1 AES_STATUS_RESERVED - 1
#define AESXYZCCXXXX_STATUS_ERROR2 AES_STATUS_RESERVED - 2

Enumeration Type Documentation

§ AES_ReturnBehavior

The return behavior of AES functions.

Not all AES operations exhibit the specified return behavior. Functions that do not require significant computation and cannot offload that computation to a background thread behave like regular functions. Which functions exhibit the specified return behavior is not implementation dependent. Specifically, a software-backed implementation run on the same CPU as the application will emulate the return behavior while not actually offloading the computation to the background thread.

AES functions exhibiting the specified return behavior have restrictions on the context from which they may be called.

Task Hwi Swi
AES_RETURN_BEHAVIOR_CALLBACK X X X
AES_RETURN_BEHAVIOR_BLOCKING X
AES_RETURN_BEHAVIOR_POLLING X X X
Enumerator
AES_RETURN_BEHAVIOR_CALLBACK 

The function call will return immediately while the operation goes on in the background. The registered callback function is called after the operation completes. The context the callback function is called (task, HWI, SWI) is implementation-dependent.

AES_RETURN_BEHAVIOR_BLOCKING 

The function call will block while the operation goes on in the background. Operation results are available after the function returns.

AES_RETURN_BEHAVIOR_POLLING 

The function call will continuously poll a flag while operation goes on in the background. Operation results are available after the function returns.

© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale