Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
#include <cipher_structs.h>
Data Fields | |
struct cipher_ops | ops |
union { | |
uint8_t * bit_stream | |
void * handle | |
} | key |
const struct device * | device |
void * | drv_sessn_state |
void * | app_sessn_state |
union { | |
struct ccm_params ccm_info | |
struct ctr_params ctr_info | |
struct gcm_params gcm_info | |
} | mode_params |
uint16_t | keylen |
uint16_t | flags |
Structure encoding session parameters.
Refer to comments for individual fields to know the contract in terms of who fills what and when w.r.t begin_session() call.
void* cipher_ctx::app_sessn_state |
Place for the user app to put info relevant stuff for resuming when completion callback happens for async ops. Totally managed by the app.
uint8_t* cipher_ctx::bit_stream |
struct ccm_params cipher_ctx::ccm_info |
struct ctr_params cipher_ctx::ctr_info |
const struct device* cipher_ctx::device |
The device driver instance this crypto context relates to. Will be populated by the begin_session() API.
void* cipher_ctx::drv_sessn_state |
If the driver supports multiple simultaneously crypto sessions, this will identify the specific driver state this crypto session relates to. Since dynamic memory allocation is not possible, it is suggested that at build time drivers allocate space for the max simultaneous sessions they intend to support. To be populated by the driver on return from begin_session().
uint16_t cipher_ctx::flags |
How certain fields are to be interpreted for this session. (A bitmask of CAP_* below.) To be populated by the app before calling begin_session(). An app can obtain the capability flags supported by a hw/driver by calling cipher_query_hwcaps().
struct gcm_params cipher_ctx::gcm_info |
void* cipher_ctx::handle |
union { ... } cipher_ctx::key |
To be populated by the app before calling begin_session()
uint16_t cipher_ctx::keylen |
Cryptographic keylength in bytes. To be populated by the app before calling begin_session()
union { ... } cipher_ctx::mode_params |
Cypher mode parameters, which remain constant for all ops in a session. To be populated by the app before calling begin_session().
struct cipher_ops cipher_ctx::ops |
Place for driver to return function pointers to be invoked per cipher operation. To be populated by crypto driver on return from begin_session() based on the algo/mode chosen by the app.