Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
cipher_ctx Struct Reference

#include <cipher_structs.h>

Data Fields

struct cipher_ops ops
 
union {
   uint8_t *   bit_stream
 
   void *   handle
 
key
 
const struct devicedevice
 
voiddrv_sessn_state
 
voidapp_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
 

Detailed Description

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.

Field Documentation

◆ app_sessn_state

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.

◆ bit_stream

uint8_t* cipher_ctx::bit_stream

◆ ccm_info

struct ccm_params cipher_ctx::ccm_info

◆ ctr_info

struct ctr_params cipher_ctx::ctr_info

◆ device

const struct device* cipher_ctx::device

The device driver instance this crypto context relates to. Will be populated by the begin_session() API.

◆ drv_sessn_state

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().

◆ flags

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().

◆ gcm_info

struct gcm_params cipher_ctx::gcm_info

◆ handle

void* cipher_ctx::handle

◆ 

union { ... } cipher_ctx::key

To be populated by the app before calling begin_session()

◆ keylen

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().

◆ ops

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.


The documentation for this struct was generated from the following file: