Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
Structure encoding session parameters. More...
#include <cipher.h>
Data Fields | ||
struct cipher_ops | ops | |
Place for driver to return function pointers to be invoked per cipher operation. | ||
union { | ||
const uint8_t * bit_stream | ||
void * handle | ||
} | key | |
To be populated by the app before calling begin_session() | ||
const struct device * | device | |
The device driver instance this crypto context relates to. | ||
void * | drv_sessn_state | |
If the driver supports multiple simultaneously crypto sessions, this will identify the specific driver state this crypto session relates to. | ||
void * | app_sessn_state | |
Place for the user app to put info relevant stuff for resuming when completion callback happens for async ops. | ||
union { | ||
struct ccm_params ccm_info | ||
struct ctr_params ctr_info | ||
struct gcm_params gcm_info | ||
} | mode_params | |
Cypher mode parameters, which remain constant for all ops in a session. | ||
uint16_t | keylen | |
Cryptographic keylength in bytes. | ||
uint16_t | flags | |
How certain fields are to be interpreted for this session. | ||
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.
const 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 crypto_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.