This module contains APIs to program and use the SA3UL.
|
file | sa3ul.h |
| This file contains the prototype of SA3UL driver APIs.
|
|
◆ SA3UL_MAX_HASH_SIZE_BYTES
#define SA3UL_MAX_HASH_SIZE_BYTES (64U) |
◆ SA3UL_MAX_KEY_SIZE_BYTES
#define SA3UL_MAX_KEY_SIZE_BYTES (32U) |
◆ SA3UL_MAX_IV_SIZE_BYTES
#define SA3UL_MAX_IV_SIZE_BYTES (16U) |
Max Initialization vector (IV) size in bytes.
◆ SA3UL_NUMBER_OF_RINGS
#define SA3UL_NUMBER_OF_RINGS (3U) |
◆ SA3UL_CACHELINE_ALIGNMENT
#define SA3UL_CACHELINE_ALIGNMENT (128U) |
Cache line size for alignment of descriptor and buffers.
◆ SA3UL_SECCTX_SIZE
#define SA3UL_SECCTX_SIZE (256U) |
◆ SA3UL_INSTANCES_MAX
#define SA3UL_INSTANCES_MAX (4U) |
◆ SA3UL_RING_N_ELEMS
#define SA3UL_RING_N_ELEMS (8U) |
Max SA3UL ring n elements.
◆ SA3UL_SW_RING_NUM
#define SA3UL_SW_RING_NUM (304U) |
Max SA3UL sw ring number.
◆ SA3UL_MAX_INPUT_LENGTH_ENC
#define SA3UL_MAX_INPUT_LENGTH_ENC (0xFFFFU) |
Max Aes input length for encryption and decryption (64KB-1)
◆ SA3UL_MAX_INPUT_LENGTH_AUTH
#define SA3UL_MAX_INPUT_LENGTH_AUTH (0x3FFFFFU) |
Max input length for authentication (4MB-1)
◆ SA3UL_HASH_ALG_NULL
#define SA3UL_HASH_ALG_NULL (0x10U) |
◆ SA3UL_HASH_ALG_SHA1
#define SA3UL_HASH_ALG_SHA1 (0x12U) |
◆ SA3UL_HASH_ALG_SHA2_256
#define SA3UL_HASH_ALG_SHA2_256 (0x14U) |
◆ SA3UL_HASH_ALG_SHA2_512
#define SA3UL_HASH_ALG_SHA2_512 (0x16U) |
◆ SA3UL_OP_ENC
#define SA3UL_OP_ENC (0x01U) |
SA3UL operations encryption.
◆ SA3UL_OP_AUTH
#define SA3UL_OP_AUTH (0x02U) |
SA3UL operations authentication.
◆ SA3UL_OP_ENC_THEN_AUTH
#define SA3UL_OP_ENC_THEN_AUTH (0x03U) |
SA3UL operation encryption then authentication.
◆ SA3UL_OP_AUTH_THEN_ENC
#define SA3UL_OP_AUTH_THEN_ENC (0x04U) |
SA3UL operations authentication then encryption.
◆ SA3UL_ENGINE_CODE_DEFAULT_ENGINE_ID
#define SA3UL_ENGINE_CODE_DEFAULT_ENGINE_ID (0U) |
◆ SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P1
#define SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P1 (2U) |
SA3UL Encryption engine module p1.
◆ SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P2
#define SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P2 (3U) |
SA3UL Encryption engine module p2.
◆ SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P1
#define SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P1 (4U) |
SA3UL Authentication engine module p1.
◆ SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P2
#define SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P2 (5U) |
SA3UL Authentication engine module p2.
◆ SA3UL_ENGINE_CODE_DEFAULT_EGRESS_PORT
#define SA3UL_ENGINE_CODE_DEFAULT_EGRESS_PORT (20U) |
SA3UL Default Engress Port.
◆ SA3UL_ENC_ALG_AES
#define SA3UL_ENC_ALG_AES (0x0U) |
SA3UL AES Encryption Algorithm.
◆ SA3UL_ENC_ALG_TDES
#define SA3UL_ENC_ALG_TDES (0x1U) |
SA3UL TDES Encryption Algorithm.
◆ SA3UL_ENC_ALG_MAX
#define SA3UL_ENC_ALG_MAX (0x2U) |
SA3UL Encryption Maximun number of Algorithms.
◆ SA3UL_ENC_DIR_ENCRYPT
#define SA3UL_ENC_DIR_ENCRYPT (0x0U) |
◆ SA3UL_ENC_DIR_DECRYPT
#define SA3UL_ENC_DIR_DECRYPT (0x1U) |
◆ SA3UL_ENC_MODE_ECB
#define SA3UL_ENC_MODE_ECB (0x0U) |
◆ SA3UL_ENC_MODE_CBC
#define SA3UL_ENC_MODE_CBC (0x1U) |
◆ SA3UL_ENC_MODE_MAX
#define SA3UL_ENC_MODE_MAX (0x2U) |
Maximun Encryption modes.
◆ SA3UL_ENC_KEYSIZE_128
#define SA3UL_ENC_KEYSIZE_128 (0x0U) |
Encryption 128 bit key size.
◆ SA3UL_ENC_KEYSIZE_192
#define SA3UL_ENC_KEYSIZE_192 (0x1U) |
Encryption 192 bit key size.
◆ SA3UL_ENC_KEYSIZE_256
#define SA3UL_ENC_KEYSIZE_256 (0x2U) |
Encryption 256 bit key size.
◆ SA3UL_ENC_KEYSIZE_MAX
#define SA3UL_ENC_KEYSIZE_MAX (0x3U) |
◆ SA3UL_ENC_KEYSIZE_BITS
#define SA3UL_ENC_KEYSIZE_BITS |
( |
|
k | ) |
(128u + (64u * (k))) |
◆ SA3UL_Handle
◆ SA3UL_init()
This function initializes the SA3UL module.
◆ SA3UL_deinit()
void SA3UL_deinit |
( |
void |
| ) |
|
This function de-initializes the SA3UL module.
◆ SA3UL_open()
This function opens a given SA3UL module.
- Parameters
-
index | Index of config to use in the SA3UL_Config array |
params | Pointer to open parameters. If NULL is passed, then default values will be used |
- Returns
- A SA3UL_Handle on success or a NULL on an error or if it has been opened already
◆ SA3UL_close()
Function to close a SA3UL module specified by the SA3UL handle.
- Parameters
-
◆ SA3UL_contextAlloc()
Function to configure secure context.
- Parameters
-
- Returns
- A SystemP_SUCCESS on success or a NULL on an error or if the instance index has NOT been opened yet
◆ SA3UL_contextFree()
Function to free secure context configuration.
- Parameters
-
- Returns
- A SystemP_SUCCESS on success or a NULL on an error or if the instance index has NOT been opened yet
◆ SA3UL_contextProcess()
int32_t SA3UL_contextProcess |
( |
SA3UL_ContextObject * |
ctxObj, |
|
|
const uint8_t * |
input, |
|
|
uint32_t |
ilen, |
|
|
uint8_t * |
output |
|
) |
| |
Function to transfer and recieve data buffer.
- Parameters
-
ctxObj | Pointer to SA3UL_ContextObject structure |
input | Pointer to input buffer to be processed |
ilen | Length of the input buffer |
output | Pointer to output buffer after the process is complete |
- Returns
- A SystemP_SUCCESS on success or a NULL on an error or if the instance index has NOT been opened yet
◆ SA3UL_Params_init()
Function to initialize default SA3UL parameters.
- Parameters
-
prms | Pointer to open parameters. |
◆ SA3UL_rngSetup()
setup the SA3UL RNG module.
- Parameters
-
- Returns
- SystemP_SUCCESS if successful
◆ SA3UL_rngRead()
int32_t SA3UL_rngRead |
( |
SA3UL_Handle |
handle, |
|
|
uint32_t * |
out |
|
) |
| |
Read random numbers into the output buffer.
- Parameters
-
- Returns
- returns SystemP_SUCCESS if requested data is available. SystemP_FAILURE if RNG is not initialized.
◆ SA3UL_ContextParams_init()
◆ gSa3ulConfig
Externally defined driver configuration array.
◆ gSa3ulConfigNum
Externally defined driver configuration Num.