Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cipher_ctx Struct Reference

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 devicedevice
 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.
 

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

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

◆ gcm_info

struct gcm_params cipher_ctx::gcm_info

◆ handle

void* cipher_ctx::handle

◆ [union]

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]

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: