Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

CryptoCell library basic APIs

CryptoCell library basic APIs

Enumerations

enum  SA_SilibRetCode_t {
  SA_SILIB_RET_OK = 0, SA_SILIB_RET_EINVAL_CTX_PTR, SA_SILIB_RET_EINVAL_WORK_BUF_PTR, SA_SILIB_RET_HAL,
  SA_SILIB_RET_PAL, SA_SILIB_RET_RND_INST_ERR, SA_SILIB_RET_EINVAL_HW_VERSION, SA_SILIB_RET_EINVAL_HW_SIGNATURE,
  SA_SILIB_RESERVE32B = 0x7FFFFFFFL
}

Functions

SA_SilibRetCode_t SaSi_LibInit (void *rnd_ctx, CRYS_RND_WorkBuff_t *rndWorkBuff_ptr)
 This function Perform global initialization of the ARM CryptoCell 3xx runtime library; it must be called once per ARM CryptoCell for 3xx cold boot cycle. Among other initializations, this function calls CRYS_RND_Instantiation and CRYS_RND_SetGenerateVectorFunc to initialize the TRNG and the primary RND context. An initialized RND context is required for calling RND APIs and asymmetric cryptography key generation and signatures. The primary context returned by this function can be used as a single global context for all RND needs. Alternatively, other contexts may be initialized and used with a more limited scope (for specific applications or specific threads).
SA_SilibRetCode_t SaSi_LibFini (void *rnd_ctx)
 This function finalize the library operations. It frees the associated resources (mutexes) and call hal and pal terminate functions. the function also call CRYS_RND_UnInstantiation to clean the rnd state.

Enumeration Type Documentation

Definitions for error returns from SaSi_LibInit or SaSi_LibFini functions.

Enumerator:
SA_SILIB_RET_OK 

Success defintion.

SA_SILIB_RET_EINVAL_CTX_PTR 

Illegal context pointer.

SA_SILIB_RET_EINVAL_WORK_BUF_PTR 

Illegal work buffer pointer.

SA_SILIB_RET_HAL 

Error returned from HAL layer.

SA_SILIB_RET_PAL 

Error returned from PAL layer.

SA_SILIB_RET_RND_INST_ERR 

RND instantiation faied.

SA_SILIB_RET_EINVAL_HW_VERSION 

Invalid HW version.

SA_SILIB_RET_EINVAL_HW_SIGNATURE 

Invalid HW signature.

SA_SILIB_RESERVE32B 

Reserved.

Definition at line 58 of file sns_silib.h.


Function Documentation

SA_SilibRetCode_t SaSi_LibFini ( void *  rnd_ctx )

This function finalize the library operations. It frees the associated resources (mutexes) and call hal and pal terminate functions. the function also call CRYS_RND_UnInstantiation to clean the rnd state.

Returns:
SA_SILIB_RET_OK on success.
A non-zero value in case of failure.
Parameters:
[in,out]rnd_ctxPointer to the RND state buffer that was initialized in SaSi_LibInit.
SA_SilibRetCode_t SaSi_LibInit ( void *  rnd_ctx,
CRYS_RND_WorkBuff_t rndWorkBuff_ptr 
)

This function Perform global initialization of the ARM CryptoCell 3xx runtime library; it must be called once per ARM CryptoCell for 3xx cold boot cycle. Among other initializations, this function calls CRYS_RND_Instantiation and CRYS_RND_SetGenerateVectorFunc to initialize the TRNG and the primary RND context. An initialized RND context is required for calling RND APIs and asymmetric cryptography key generation and signatures. The primary context returned by this function can be used as a single global context for all RND needs. Alternatively, other contexts may be initialized and used with a more limited scope (for specific applications or specific threads).

Note:
The Mutexes, if used, are initialized by this API. Therefore, unlike the other APIs in the library, this API is not thread-safe.
Returns:
SA_SILIB_RET_OK on success.
A non-zero value in case of failure.
Parameters:
[in,out]rnd_ctxPointer to the RND state buffer, allocated by the user. This state must be saved and provided as parameter to any API that uses the RND module.
[in]rndWorkBuff_ptrScratchpad for the RND module's work.