Modules | |
CryptoCell AES definitions | |
CryptoCell AES specific errors | |
Data Structures | |
struct | SaSiAesUserContext_t |
struct | SaSiAesUserKeyData_t |
struct | SaSiAesHwKeyData_t |
Typedefs | |
typedef uint8_t | SaSiAesIv_t[(4 *sizeof(uint32_t))] |
typedef uint8_t | SaSiAesKeyBuffer_t[(4 *sizeof(uint32_t))] |
typedef struct SaSiAesUserContext_t | SaSiAesUserContext_t |
typedef struct SaSiAesUserKeyData_t | SaSiAesUserKeyData_t |
typedef struct SaSiAesHwKeyData_t | SaSiAesHwKeyData_t |
Enumerations |
Functions | |
SaSiStatus | SaSi_AesInit (SaSiAesUserContext_t *pContext, SaSiAesEncryptMode_t encryptDecryptFlag, SaSiAesOperationMode_t operationMode, SaSiAesPaddingType_t paddingType) |
This function is used to initialize an AES operation context. To operate the AES machine, this must be the first API called. More... | |
SaSiStatus | SaSi_AesSetKey (SaSiAesUserContext_t *pContext, SaSiAesKeyType_t keyType, void *pKeyData, size_t keyDataSize) |
This function sets the key information for the AES operation, in the context that was initialized by SaSi_AesInit. More... | |
SaSiStatus | SaSi_AesSetIv (SaSiAesUserContext_t *pContext, SaSiAesIv_t pIV) |
This function sets the IV, counter or tweak data for the following AES operation on the same context. The context must be first initialized by SaSi_AesInit. It must be called at least once prior to the first SaSi_AesBlock operation on the same context - for those ciphers that require it. If needed, it can also be called to override the IV in the middle of a sequence of SaSi_AesBlock operations. More... | |
SaSiStatus | SaSi_AesGetIv (SaSiAesUserContext_t *pContext, SaSiAesIv_t pIV) |
This function retrieves the current IV, counter or tweak from the AES context. More... | |
SaSiStatus | SaSi_AesBlock (SaSiAesUserContext_t *pContext, uint8_t *pDataIn, size_t dataInSize, uint8_t *pDataOut) |
This function performs an AES operation on an input data buffer, according to the configuration defined in the context parameter. It can be called as many times as needed, until all the input data is processed. SaSi_AesInit, SaSi_AesSetKey, and for some ciphers SaSi_AesSetIv, must be called before the first call to this API with the same context. More... | |
SaSiStatus | SaSi_AesFinish (SaSiAesUserContext_t *pContext, size_t dataSize, uint8_t *pDataIn, size_t dataInBuffSize, uint8_t *pDataOut, size_t *dataOutBuffSize) |
This function is used to finish AES operation. More... | |
SaSiStatus | SaSi_AesFree (SaSiAesUserContext_t *pContext) |
This function releases and crears resources after AES operations. More... | |
typedef struct SaSiAesHwKeyData_t SaSiAesHwKeyData_t |
AES HW Key Data - this structure is likely to be changed when we'll start using it.
typedef uint8_t SaSiAesIv_t[( 4 *sizeof(uint32_t))] |
typedef uint8_t SaSiAesKeyBuffer_t[(4 *sizeof(uint32_t))] |
typedef struct SaSiAesUserContext_t SaSiAesUserContext_t |
The user's context prototype - the argument type that is passed by the user to the AES APIs. The context saves the state of the operation and must be saved by the user till the end of the APIs flow
typedef struct SaSiAesUserKeyData_t SaSiAesUserKeyData_t |
AES User Key Data.
enum SaSiAesEncryptMode_t |
enum SaSiAesKeyType_t |
AES operation mode.
enum SaSiAesPaddingType_t |
SaSiStatus SaSi_AesBlock | ( | SaSiAesUserContext_t * | pContext, |
uint8_t * | pDataIn, | ||
size_t | dataInSize, | ||
uint8_t * | pDataOut | ||
) |
This function performs an AES operation on an input data buffer, according to the configuration defined in the context parameter. It can be called as many times as needed, until all the input data is processed. SaSi_AesInit, SaSi_AesSetKey, and for some ciphers SaSi_AesSetIv, must be called before the first call to this API with the same context.
[in] | pContext | Pointer to the AES context. |
[in] | pDataIn | Pointer to the buffer of the input data to the AES. The pointer does not need to be aligned. For TZ, the size of the scatter/gather list representing the data buffer is limited to 128 entries, and the size of each entry is limited to 64KB (fragments larger than 64KB are broken into fragments <= 64KB). For ARM CryptoCell 3xx, The buffer must be contiguous and limited to 64KB. |
[in] | dataInSize | Size of the input data in bytes.
|
[out] | pDataOut | Pointer to the output buffer. The pointer does not need to be aligned. For CBC-MAC, XCBC-MAC, CMAC modes it may be NULL. For TZ, the size of the scatter/gather list representing the data buffer is limited to 128 entries, and the size of each entry is limited to 64KB (fragments larger than 64KB are broken into fragments <= 64KB). For ARM CryptoCell 3xx, The buffer must be contiguous and limited to 64KB. |
SaSiStatus SaSi_AesFinish | ( | SaSiAesUserContext_t * | pContext, |
size_t | dataSize, | ||
uint8_t * | pDataIn, | ||
size_t | dataInBuffSize, | ||
uint8_t * | pDataOut, | ||
size_t * | dataOutBuffSize | ||
) |
This function is used to finish AES operation.
It processes the last data block if needed, finalizes the AES operation (cipher-specific), and produces operation results (for MAC operations).
[in] | pContext | Pointer to the AES context. |
[in] | dataSize | The size of the input data in bytes.
|
[in] | pDataIn | Pointer of the input data buffer. For TZ, the size of the scatter/gather list representing the data buffer is limited to 128 entries, and the size of each entry is limited to 64KB (fragments larger than 64KB are broken into fragments <= 64KB). For ARM CryptoCell 3xx, The buffer must be contiguous and limited to 64KB. |
[in] | dataInBuffSize | Size of pDataIn buffer in bytes.
|
[out] | pDataOut | Pointer to the output buffer. For TZ, the size of the scatter/gather list representing the data buffer is limited to 128 entries, and the size of each entry is limited to 64KB (fragments larger than 64KB are broken into fragments <= 64KB). For ARM CryptoCell 3xx, The buffer must be contiguous and limited to 64KB. |
[in,out] | dataOutBuffSize | In - Size of pDataOut buffer in bytes. The output buffer size must be no less than:
|
SaSiStatus SaSi_AesFree | ( | SaSiAesUserContext_t * | pContext | ) |
This function releases and crears resources after AES operations.
[in] | pContext | Pointer to the AES context. |
SaSiStatus SaSi_AesGetIv | ( | SaSiAesUserContext_t * | pContext, |
SaSiAesIv_t | pIV | ||
) |
This function retrieves the current IV, counter or tweak from the AES context.
[in] | pContext | Pointer to the AES context. |
[out] | pIV | Pointer to the buffer of the IV, counter or tweak.
|
SaSiStatus SaSi_AesInit | ( | SaSiAesUserContext_t * | pContext, |
SaSiAesEncryptMode_t | encryptDecryptFlag, | ||
SaSiAesOperationMode_t | operationMode, | ||
SaSiAesPaddingType_t | paddingType | ||
) |
This function is used to initialize an AES operation context. To operate the AES machine, this must be the first API called.
[in] | pContext | Pointer to the AES context buffer that is allocated by the caller and initialized by this API. Should be used in all subsequent calls that are part of the same operation. |
[in] | encryptDecryptFlag | A flag specifying whether an AES Encrypt (SASI_AES_Encrypt) or Decrypt (SASI_AES_Decrypt) operation should be performed. Must be set to CRYS_AES_Encrypt in CBC-MAC, XCBC-MAC and CMAC modes. |
[in] | operationMode | The operation cipher/mode. |
[in] | paddingType | The padding type for AES operation:
|
SaSiStatus SaSi_AesSetIv | ( | SaSiAesUserContext_t * | pContext, |
SaSiAesIv_t | pIV | ||
) |
This function sets the IV, counter or tweak data for the following AES operation on the same context. The context must be first initialized by SaSi_AesInit. It must be called at least once prior to the first SaSi_AesBlock operation on the same context - for those ciphers that require it. If needed, it can also be called to override the IV in the middle of a sequence of SaSi_AesBlock operations.
[in] | pContext | Pointer to the AES context. |
[in] | pIV | Pointer to the buffer of the IV, counter or tweak.
|
SaSiStatus SaSi_AesSetKey | ( | SaSiAesUserContext_t * | pContext, |
SaSiAesKeyType_t | keyType, | ||
void * | pKeyData, | ||
size_t | keyDataSize | ||
) |
This function sets the key information for the AES operation, in the context that was initialized by SaSi_AesInit.
[in] | pContext | Pointer to the AES context, after it was initialized by SaSi_AesInit. |
[in] | keyType | The type of key to be used for the AES operation. Currently only SASI_AES_USER_KEY is supported - the key is plaintext and provided in the pKeyData parameter. |
[in] | pKeyData | Pointer to the key data structure (to be casted to the relevant struct type). |
[in] | keyDataSize | The size of data passed in pKeyData in bytes. |