17#ifndef ZEPHYR_INCLUDE_CRYPTO_CIPHER_H_
18#define ZEPHYR_INCLUDE_CRYPTO_CIPHER_H_
void(* cipher_completion_cb)(struct cipher_pkt *completed, int status)
Definition cipher.h:242
cipher_op
Cipher Operation.
Definition cipher.h:34
int(* ccm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt, uint8_t *nonce)
Definition cipher.h:68
int(* block_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt)
Definition cipher.h:57
cipher_algo
Cipher Algorithm.
Definition cipher.h:29
int(* cbc_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, uint8_t *iv)
Definition cipher.h:62
int(* ctr_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, uint8_t *ctr)
Definition cipher.h:65
int(* gcm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt, uint8_t *nonce)
Definition cipher.h:71
cipher_mode
Possible cipher mode options.
Definition cipher.h:44
@ CRYPTO_CIPHER_OP_DECRYPT
Definition cipher.h:35
@ CRYPTO_CIPHER_OP_ENCRYPT
Definition cipher.h:36
@ CRYPTO_CIPHER_ALGO_AES
Definition cipher.h:30
@ CRYPTO_CIPHER_MODE_GCM
Definition cipher.h:49
@ CRYPTO_CIPHER_MODE_ECB
Definition cipher.h:45
@ CRYPTO_CIPHER_MODE_CCM
Definition cipher.h:48
@ CRYPTO_CIPHER_MODE_CTR
Definition cipher.h:47
@ CRYPTO_CIPHER_MODE_CBC
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
uint16_t tag_len
Definition cipher.h:88
uint16_t nonce_len
Definition cipher.h:89
Structure encoding IO parameters in AEAD (Authenticated Encryption with Associated Data) scenario lik...
Definition cipher.h:217
uint8_t * ad
Start address for Associated Data.
Definition cipher.h:224
uint32_t ad_len
Size of Associated Data.
Definition cipher.h:227
uint8_t * tag
Start address for the auth hash.
Definition cipher.h:233
struct cipher_pkt * pkt
Definition cipher.h:219
Structure encoding session parameters.
Definition cipher.h:110
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:146
uint16_t keylen
Cryptographic keylength in bytes.
Definition cipher.h:161
struct ccm_params ccm_info
Definition cipher.h:153
const struct device * device
The device driver instance this crypto context relates to.
Definition cipher.h:131
uint16_t flags
How certain fields are to be interpreted for this session.
Definition cipher.h:169
void * drv_sessn_state
If the driver supports multiple simultaneously crypto sessions, this will identify the specific drive...
Definition cipher.h:140
void * handle
Definition cipher.h:125
struct ctr_params ctr_info
Definition cipher.h:154
union cipher_ctx::@174 key
To be populated by the app before calling begin_session()
struct gcm_params gcm_info
Definition cipher.h:155
const uint8_t * bit_stream
Definition cipher.h:121
union cipher_ctx::@175 mode_params
Cypher mode parameters, which remain constant for all ops in a session.
struct cipher_ops ops
Place for driver to return function pointers to be invoked per cipher operation.
Definition cipher.h:116
block_op_t block_crypt_hndlr
Definition cipher.h:79
gcm_op_t gcm_crypt_hndlr
Definition cipher.h:83
enum cipher_mode cipher_mode
Definition cipher.h:76
cbc_op_t cbc_crypt_hndlr
Definition cipher.h:80
ctr_op_t ctr_crypt_hndlr
Definition cipher.h:81
ccm_op_t ccm_crypt_hndlr
Definition cipher.h:82
Structure encoding IO parameters of one cryptographic operation like encrypt/decrypt.
Definition cipher.h:180
struct cipher_ctx * ctx
Context this packet relates to.
Definition cipher.h:208
uint8_t * in_buf
Start address of input buffer.
Definition cipher.h:183
int out_buf_max
Size of the out_buf area allocated by the application.
Definition cipher.h:197
uint8_t * out_buf
Start of the output buffer, to be allocated by the application.
Definition cipher.h:192
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:202
int in_len
Bytes to be operated upon.
Definition cipher.h:186
uint32_t ctr_len
Definition cipher.h:96
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
uint16_t tag_len
Definition cipher.h:100
uint16_t nonce_len
Definition cipher.h:101