18#ifndef ZEPHYR_INCLUDE_CRYPTO_CIPHER_H_
19#define ZEPHYR_INCLUDE_CRYPTO_CIPHER_H_
void(* cipher_completion_cb)(struct cipher_pkt *completed, int status)
Handle completion of an asynchronous cipher request.
Definition cipher.h:347
cipher_op
Cipher operation types.
Definition cipher.h:34
int(* ccm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt, uint8_t *nonce)
Perform a CCM authenticated cipher operation.
Definition cipher.h:108
int(* block_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt)
Perform an ECB block cipher operation.
Definition cipher.h:66
cipher_algo
Cipher algorithms.
Definition cipher.h:29
int(* cbc_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, uint8_t *iv)
Perform a CBC cipher operation.
Definition cipher.h:79
int(* ctr_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, uint8_t *ctr)
Perform a CTR cipher operation.
Definition cipher.h:93
int(* gcm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt, uint8_t *nonce)
Perform a GCM authenticated cipher operation.
Definition cipher.h:123
cipher_mode
Possible cipher mode options.
Definition cipher.h:44
@ CRYPTO_CIPHER_OP_DECRYPT
Decrypt input data.
Definition cipher.h:35
@ CRYPTO_CIPHER_OP_ENCRYPT
Encrypt input data.
Definition cipher.h:36
@ CRYPTO_CIPHER_ALGO_AES
Advanced Encryption Standard.
Definition cipher.h:30
@ CRYPTO_CIPHER_MODE_GCM
Galois/Counter mode.
Definition cipher.h:49
@ CRYPTO_CIPHER_MODE_ECB
Electronic Codebook mode.
Definition cipher.h:45
@ CRYPTO_CIPHER_MODE_CCM
Counter with CBC-MAC mode.
Definition cipher.h:48
@ CRYPTO_CIPHER_MODE_CTR
Counter mode.
Definition cipher.h:47
@ CRYPTO_CIPHER_MODE_CBC
Cipher Block Chaining mode.
Definition cipher.h:46
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
CCM mode session parameters.
Definition cipher.h:153
uint16_t tag_len
Authentication tag length, in bytes.
Definition cipher.h:155
uint16_t nonce_len
Nonce length, in bytes.
Definition cipher.h:157
Structure encoding IO parameters in AEAD (Authenticated Encryption with Associated Data) scenario lik...
Definition cipher.h:309
uint8_t * ad
Start address of associated data.
Definition cipher.h:320
uint32_t ad_len
Size of associated data, in bytes.
Definition cipher.h:323
uint8_t * tag
Start address of the authentication tag buffer.
Definition cipher.h:332
struct cipher_pkt * pkt
Packet containing input and output buffers.
Definition cipher.h:314
Structure encoding session parameters.
Definition cipher.h:185
void * app_sessn_state
Place for the user app to put info relevant stuff for resuming when completion callback happens for a...
Definition cipher.h:228
uint16_t keylen
Cryptographic keylength in bytes.
Definition cipher.h:246
struct ccm_params ccm_info
CCM parameters for CCM sessions.
Definition cipher.h:236
union cipher_ctx::@252266264254052346115200201223263334036213076237 key
Key material for the session.
const struct device * device
The device driver instance this crypto context relates to.
Definition cipher.h:213
uint16_t flags
How certain fields are to be interpreted for this session.
Definition cipher.h:254
void * drv_sessn_state
If the driver supports multiple simultaneously crypto sessions, this will identify the specific drive...
Definition cipher.h:222
void * handle
Driver-specific key handle for protected keys that are not directly available to the application.
Definition cipher.h:207
struct ctr_params ctr_info
CTR parameters for CTR sessions.
Definition cipher.h:238
struct gcm_params gcm_info
GCM parameters for GCM sessions.
Definition cipher.h:240
union cipher_ctx::@154152356303000122313150276277376275054131233366 mode_params
Cipher mode parameters, which remain constant for all ops in a session.
const uint8_t * bit_stream
Raw cryptographic key bytes.
Definition cipher.h:202
struct cipher_ops ops
Place for driver to return function pointers to be invoked per cipher operation.
Definition cipher.h:191
Cipher operation handlers selected for a session.
Definition cipher.h:132
block_op_t block_crypt_hndlr
Handler for ECB block operations.
Definition cipher.h:140
gcm_op_t gcm_crypt_hndlr
Handler for GCM authenticated operations.
Definition cipher.h:148
enum cipher_mode cipher_mode
Cipher mode associated with the active handler.
Definition cipher.h:135
cbc_op_t cbc_crypt_hndlr
Handler for CBC operations.
Definition cipher.h:142
ctr_op_t ctr_crypt_hndlr
Handler for CTR operations.
Definition cipher.h:144
ccm_op_t ccm_crypt_hndlr
Handler for CCM authenticated operations.
Definition cipher.h:146
Structure encoding IO parameters of one cryptographic operation like encrypt/decrypt.
Definition cipher.h:265
struct cipher_ctx * ctx
Context this packet relates to.
Definition cipher.h:300
uint8_t * in_buf
Start address of the input buffer.
Definition cipher.h:271
int out_buf_max
Size of the output buffer, in bytes.
Definition cipher.h:289
uint8_t * out_buf
Start address of the output buffer.
Definition cipher.h:283
int out_len
To be populated by driver on return from cipher_xxx_op() and holds the size of the actual result.
Definition cipher.h:294
int in_len
Number of input bytes to process.
Definition cipher.h:274
CTR mode session parameters.
Definition cipher.h:161
uint32_t ctr_len
Counter length, in bytes.
Definition cipher.h:168
GCM mode session parameters.
Definition cipher.h:172
uint16_t tag_len
Authentication tag length, in bytes.
Definition cipher.h:174
uint16_t nonce_len
Nonce length, in bytes.
Definition cipher.h:176