Virgil IoT KIT
Macros | Functions
vs-soft-secmodule.h File Reference

Software Security Module implementation. More...

#include <virgil/iot/secmodule/secmodule.h>
#include <virgil/iot/storage_hal/storage_hal.h>

Go to the source code of this file.

Macros

#define VS_SLOTS_STORAGE_MAX_SIZE   (1024)
 

Functions

vs_secmodule_impl_tvs_soft_secmodule_impl (vs_storage_op_ctx_t *slots_storage_impl)
 Initialize software crypto implementation. More...
 
vs_status_e vs_soft_secmodule_deinit (void)
 Destroy software crypto implementation. More...
 

Detailed Description

Software Security Module implementation.

This library can be used when no Hardware Security Module support provided.

You need initialize vs-soft-secmodule module before its usage and free it after. See code below for example:

vs_storage_op_ctx_t slots_storage_impl; // Storage implementation for slot
vs_secmodule_impl_t *secmodule_impl; // Security implementation
// Init storage implementation
vs_app_storage_init_impl(&slots_storage_impl, vs_app_slots_dir(), VS_SLOTS_STORAGE_MAX_SIZE)
// You can initialize security module by software implementation :
secmodule_impl = vs_soft_secmodule_impl(&slots_storage_impl);
// Deinit soft security module

You need to implement custom storage. As an example you can see default implementation in vs_app_storage_init_impl() function in app-storage.c file.

Macro Definition Documentation

◆ VS_SLOTS_STORAGE_MAX_SIZE

#define VS_SLOTS_STORAGE_MAX_SIZE   (1024)

Function Documentation

◆ vs_soft_secmodule_deinit()

vs_status_e vs_soft_secmodule_deinit ( void  )

Destroy software crypto implementation.

Returns
VS_CODE_OK in case of success or error code.

◆ vs_soft_secmodule_impl()

vs_secmodule_impl_t* vs_soft_secmodule_impl ( vs_storage_op_ctx_t slots_storage_impl)

Initialize software crypto implementation.

Parameters
[in]slots_storage_implStorage context. Must not be NULL.
Returns
Security Module implementation
vs_secmodule_impl_t
Security Module implementation.
Definition: secmodule.h:458
vs_soft_secmodule_deinit
vs_status_e vs_soft_secmodule_deinit(void)
Destroy software crypto implementation.
vs_soft_secmodule_impl
vs_secmodule_impl_t * vs_soft_secmodule_impl(vs_storage_op_ctx_t *slots_storage_impl)
Initialize software crypto implementation.
vs_storage_op_ctx_t
Storage element context.
Definition: storage_hal.h:221
VS_SLOTS_STORAGE_MAX_SIZE
#define VS_SLOTS_STORAGE_MAX_SIZE
Definition: vs-soft-secmodule.h:70