Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cipher_ctx Struct Reference

Structure encoding session parameters. More...

#include <zephyr/crypto/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 
 Raw cryptographic key bytes. More...
   void *   handle 
 Driver-specific key handle for protected keys that are not directly available to the application. More...
key
 Key material for the 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 
 CCM parameters for CCM sessions. More...
   struct ctr_params   ctr_info 
 CTR parameters for CTR sessions. More...
   struct gcm_params   gcm_info 
 GCM parameters for GCM sessions. More...
mode_params
 Cipher 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

Raw cryptographic key bytes.

The buffer must remain valid while the session is active.

◆ ccm_info

struct ccm_params cipher_ctx::ccm_info

CCM parameters for CCM sessions.

◆ ctr_info

struct ctr_params cipher_ctx::ctr_info

CTR parameters for CTR sessions.

◆ 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

GCM parameters for GCM sessions.

◆ handle

void* cipher_ctx::handle

Driver-specific key handle for protected keys that are not directly available to the application.

◆ [union]

union { ... } cipher_ctx::key

Key material for the session.

The application populates the selected member before calling cipher_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

Cipher 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: