|
AM62Ax MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
57 #include <security/crypto/sa3ul/hw_include/cslr_cp_ace.h>
73 #define SA3UL_MAX_HASH_SIZE_BYTES (64U)
75 #define SA3UL_MAX_KEY_SIZE_BYTES (32U)
77 #define SA3UL_MAX_IV_SIZE_BYTES (16U)
79 #define SA3UL_NUMBER_OF_RINGS (3U)
81 #define SA3UL_CACHELINE_ALIGNMENT (128U)
83 #define SA3UL_SECCTX_SIZE (256U)
85 #define SA3UL_INSTANCES_MAX (4U)
87 #define SA3UL_RING_N_ELEMS (8U)
89 #define SA3UL_SW_RING_NUM (304U)
91 #define SA3UL_MAX_INPUT_LENGTH_ENC (0xFFFFU)
93 #define SA3UL_MAX_INPUT_LENGTH_AUTH (0x3FFFFFU)
102 #define SA3UL_HASH_ALG_NULL (0x10U)
104 #define SA3UL_HASH_ALG_SHA1 (0x12U)
106 #define SA3UL_HASH_ALG_SHA2_256 (0x14U)
108 #define SA3UL_HASH_ALG_SHA2_512 (0x16U)
117 #define SA3UL_OP_ENC (0x01U)
119 #define SA3UL_OP_AUTH (0x02U)
121 #define SA3UL_OP_ENC_THEN_AUTH (0x03U)
123 #define SA3UL_OP_AUTH_THEN_ENC (0x04U)
132 #define SA3UL_ENGINE_CODE_DEFAULT_ENGINE_ID (0U)
134 #define SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P1 (2U)
136 #define SA3UL_ENGINE_CODE_ENCRYPTION_MODULE_P2 (3U)
138 #define SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P1 (4U)
140 #define SA3UL_ENGINE_CODE_AUTHENTICATION_MODULE_P2 (5U)
142 #define SA3UL_ENGINE_CODE_DEFAULT_EGRESS_PORT (20U)
151 #define SA3UL_ENC_ALG_AES (0x0U)
153 #define SA3UL_ENC_ALG_TDES (0x1U)
155 #define SA3UL_ENC_ALG_MAX (0x2U)
164 #define SA3UL_ENC_DIR_ENCRYPT (0x0U)
166 #define SA3UL_ENC_DIR_DECRYPT (0x1U)
175 #define SA3UL_ENC_MODE_ECB (0x0U)
177 #define SA3UL_ENC_MODE_CBC (0x1U)
179 #define SA3UL_ENC_MODE_MAX (0x2U)
188 #define SA3UL_ENC_KEYSIZE_128 (0x0U)
190 #define SA3UL_ENC_KEYSIZE_192 (0x1U)
192 #define SA3UL_ENC_KEYSIZE_256 (0x2U)
194 #define SA3UL_ENC_KEYSIZE_MAX (0x3U)
197 #define SA3UL_ENC_KEYSIZE_BITS(k) (128u + (64u * (k)))
260 uint32_t udmapRxChnum[2];
394 uint32_t reserved1[4];
395 uint32_t authenticationKeyValueL[8];
397 uint32_t authenticationKeyValueH[8];
414 uint32_t modeCtrlInstrs[6];
416 uint32_t encKeyValue[8];
421 uint8_t preCryptoData[15];
592 memset(ctxPrms, 0,
sizeof(*ctxPrms));
int32_t SA3UL_contextFree(SA3UL_ContextObject *pCtxObj)
Function to free secure context configuration.
#define SA3UL_MAX_IV_SIZE_BYTES
Max Initialization vector (IV) size in bytes.
Definition: sa3ul.h:77
SA3UL_SecCtx secCtx
Definition: sa3ul.h:443
uint32_t encrCtl
Definition: sa3ul.h:413
uint32_t descMemAddr
Definition: sa3ul.h:338
void SA3UL_close(SA3UL_Handle handle)
Function to close a SA3UL module specified by the SA3UL handle.
uint8_t secCtxId
Definition: sa3ul.h:445
uint32_t totalLengthInBytes
Definition: sa3ul.h:449
uint32_t rxRingMemAddr
Definition: sa3ul.h:330
const uint8_t * mcInstrs
Definition: sa3ul.h:384
uint32_t rxBytesCnt
Definition: sa3ul.h:453
uint32_t sa3ulErrCnt
Definition: sa3ul.h:454
Udma_RingHandle rxRingHandle
Definition: sa3ul.h:289
Udma_ChObject udmaTxChObj
Definition: sa3ul.h:267
SA3UL_Params prms
Definition: sa3ul.h:248
#define SA3UL_MAX_KEY_SIZE_BYTES
Max key size in bytes.
Definition: sa3ul.h:75
void * Udma_FlowHandle
UDMA flow handle.
Definition: udma_types.h:73
static void SA3UL_ContextParams_init(SA3UL_ContextParams *ctxPrms)
Definition: sa3ul.h:588
Parameters passed to SA3UL_contextAlloc()
Definition: sa3ul.h:210
SA3UL context RAM structure.
Definition: sa3ul.h:428
SA3UL context RAM structure for authentication engine.
Definition: sa3ul.h:389
uint32_t privId
Definition: sa3ul.h:360
uint16_t index
Definition: tisci_rm_proxy.h:3
void SA3UL_deinit(void)
This function de-initializes the SA3UL module.
int32_t SA3UL_rngSetup(SA3UL_Handle handle)
setup the SA3UL RNG module.
void * Udma_ChHandle
UDMA channel handle.
Definition: udma_types.h:67
Opaque UDMA ring object.
Definition: udma_ring.h:612
uint32_t contextIdStart
Definition: sa3ul.h:350
int32_t SA3UL_rngRead(SA3UL_Handle handle, uint32_t *out)
Read random numbers into the output buffer.
uint32_t reserved
Definition: sa3ul.h:237
#define SA3UL_NUMBER_OF_RINGS
Max number of rings.
Definition: sa3ul.h:79
uint32_t saBaseAddr
Definition: sa3ul.h:322
SA3UL_Scctl scctl
Definition: sa3ul.h:429
uint32_t rxRingNumInt
Definition: sa3ul.h:356
SA3UL_Config gSa3ulConfig[]
Externally defined driver configuration array.
void SA3UL_init(void)
This function initializes the SA3UL module.
uint32_t secure
Definition: sa3ul.h:364
SA3UL context object structure.
Definition: sa3ul.h:442
SA3UL SC control structure.
Definition: sa3ul.h:403
#define SA3UL_INSTANCES_MAX
Max SA3UL instances.
Definition: sa3ul.h:85
uint8_t sopOffset
Definition: sa3ul.h:380
uint8_t encKeySize
Definition: sa3ul.h:223
SA3UL_SecCtxAuth auth
Definition: sa3ul.h:433
uint32_t psilInst
Definition: sa3ul.h:254
#define SA3UL_RING_N_ELEMS
Max SA3UL ring n elements.
Definition: sa3ul.h:87
SA3UL_SecCtxEnc enc
Definition: sa3ul.h:434
uint32_t descSize
Definition: sa3ul.h:336
uint32_t authenticationLengthLo
Definition: sa3ul.h:393
void * Udma_RingHandle
UDMA ring handle.
Definition: udma_types.h:71
uint32_t gSa3ulConfigNum
Externally defined driver configuration Num.
uint32_t udmaSaTxGroupNum
Definition: sa3ul.h:342
uint32_t scctl2
Definition: sa3ul.h:405
int32_t SA3UL_contextAlloc(SA3UL_Handle handle, SA3UL_ContextObject *ctxObj, const SA3UL_ContextParams *ctxPrms)
Function to configure secure context.
uint32_t storageQueueHead
Definition: sa3ul.h:300
Opaque UDMA channel object.
Definition: udma_ch.h:1156
Udma_RingHandle txRingHandle
Definition: sa3ul.h:293
SA3UL_ContextParams ctxPrms
Definition: sa3ul.h:447
Udma_ChHandle txChHandle
Definition: sa3ul.h:283
uint8_t opType
Definition: sa3ul.h:211
uint32_t rxPsil1ThreadId
Definition: sa3ul.h:328
uint32_t isOpen
Definition: sa3ul.h:250
Opaque UDMA flow object.
Definition: udma_flow.h:438
uint32_t txRingMemAddr
Definition: sa3ul.h:332
Udma_EventObject udmaEvtObj
Definition: sa3ul.h:275
SA3UL_Attrs * attrs
Definition: sa3ul.h:371
Udma_EventHandle rxEvtHandle
Definition: sa3ul.h:295
uint32_t hwCtrlWord
Definition: sa3ul.h:415
uint32_t ringCnt
Definition: sa3ul.h:346
Udma_FlowObject udmaFlowObj
Definition: sa3ul.h:271
SA3UL_Handle handle
Definition: sa3ul.h:246
uint8_t contextId
Definition: sa3ul.h:312
Object for a SA3UL crypto operation.
Definition: sa3ul.h:245
uint32_t numDesc
Definition: sa3ul.h:334
void * Udma_EventHandle
UDMA event handle.
Definition: udma_types.h:69
uint32_t swRingNumInt
Definition: sa3ul.h:358
SA3UL_Handle SA3UL_open(uint32_t index, const SA3UL_Params *params)
This function opens a given SA3UL module.
uint32_t udmaSaRxGroupNum
Definition: sa3ul.h:344
uint32_t scptrL
Definition: sa3ul.h:407
uint32_t udmapTxChnum
Definition: sa3ul.h:258
#define SA3UL_MAX_HASH_SIZE_BYTES
Max hash size in bytes.
Definition: sa3ul.h:73
uint32_t txRingNumInt
Definition: sa3ul.h:354
SA3UL context RAM structure for Encryption engine.
Definition: sa3ul.h:412
SA3UL_Object * object
Definition: sa3ul.h:373
uint32_t inputLen
Definition: sa3ul.h:225
uint32_t authCtx1
Definition: sa3ul.h:390
uint32_t txBytesCnt
Definition: sa3ul.h:452
uint32_t authenticationLengthHi
Definition: sa3ul.h:392
uint32_t priv
Definition: sa3ul.h:362
Udma_FlowHandle rxFlowHandle
Definition: sa3ul.h:285
void * SA3UL_Handle
Handle to the SA3UL driver returned by SA3UL_open()
Definition: sa3ul.h:204
uint32_t udmapRxFlownum
Definition: sa3ul.h:262
uint8_t middleOffset
Definition: sa3ul.h:381
uint8_t eopOffset
Definition: sa3ul.h:382
uint32_t rxPsil0ThreadId
Definition: sa3ul.h:326
UDMA Driver API/interface file.
uint32_t scctl1
Definition: sa3ul.h:404
int32_t SA3UL_contextProcess(SA3UL_ContextObject *ctxObj, const uint8_t *input, uint32_t ilen, uint8_t *output)
Function to transfer and recieve data buffer.
SA3UL_Handle handle
Definition: sa3ul.h:446
void * Udma_DrvHandle
UDMA driver handle.
Definition: udma_types.h:65
Udma_EventObject udmaEvtObj0
Definition: sa3ul.h:277
Udma_RingHandle txComplRingHandle
Definition: sa3ul.h:291
uint8_t encAlg
Definition: sa3ul.h:215
uint32_t contextIdMaxNum
Definition: sa3ul.h:352
Parameters passed to SA3UL_open()
Definition: sa3ul.h:236
Udma_RingHandle rxFreeRingHandle
Definition: sa3ul.h:287
Udma_DrvHandle drvHandle
Definition: sa3ul.h:279
uint8_t encMode
Definition: sa3ul.h:219
uint32_t reserved0
Definition: sa3ul.h:391
SA3UL driver context.
Definition: sa3ul.h:370
static void SA3UL_Params_init(SA3UL_Params *prms)
Function to initialize default SA3UL parameters.
Definition: sa3ul.h:580
uint32_t storageQueueTail
Definition: sa3ul.h:301
uint32_t udmaHandle
Definition: sa3ul.h:348
CSL_Cp_aceRegs * pSaRegs
Definition: sa3ul.h:252
uint8_t hashAlg
Definition: sa3ul.h:213
uint8_t nMCInstrs
Definition: sa3ul.h:383
Opaque UDMA event object.
Definition: udma_event.h:447
MEDdata for Encryption engine.
Definition: sa3ul.h:379
uint32_t descMemSize
Definition: sa3ul.h:340
uint8_t encDirection
Definition: sa3ul.h:217
SA3UL instance attributes - used during init time.
Definition: sa3ul.h:318
uint32_t txPsilThreadId
Definition: sa3ul.h:324
uint32_t computationStatus
Definition: sa3ul.h:451
uint32_t storageQueueFree
Definition: sa3ul.h:302
uint32_t scptrH
Definition: sa3ul.h:406