Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
13#ifndef ZEPHYR_INCLUDE_CRYPTO_HASH_H_
14#define ZEPHYR_INCLUDE_CRYPTO_HASH_H_
15
16
32
33/* Forward declarations */
34struct hash_ctx;
35struct hash_pkt;
36
37
38typedef int (*hash_op_t)(struct hash_ctx *ctx, struct hash_pkt *pkt,
39 bool finish);
40
47struct hash_ctx {
51 const struct device *device;
52
61
66
70 bool started;
71
79};
80
88struct hash_pkt {
89
92
94 size_t in_len;
95
102
107 struct hash_ctx *ctx;
108};
109
110/* Prototype for the application function to be invoked by the crypto driver
111 * on completion of an async request. The app may get the session context
112 * via the pkt->ctx field.
113 */
114typedef void (*hash_completion_cb)(struct hash_pkt *completed, int status);
115
116
120#endif /* ZEPHYR_INCLUDE_CRYPTO_HASH_H_ */
void(* hash_completion_cb)(struct hash_pkt *completed, int status)
Definition hash.h:114
int(* hash_op_t)(struct hash_ctx *ctx, struct hash_pkt *pkt, bool finish)
Definition hash.h:38
hash_algo
Hash algorithm.
Definition hash.h:26
@ CRYPTO_HASH_ALGO_SHA256
Definition hash.h:28
@ CRYPTO_HASH_ALGO_SHA512
Definition hash.h:30
@ CRYPTO_HASH_ALGO_SHA224
Definition hash.h:27
@ CRYPTO_HASH_ALGO_SHA384
Definition hash.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Structure encoding session parameters.
Definition hash.h:47
bool started
If it has started a multipart hash operation.
Definition hash.h:70
hash_op_t hash_hndlr
Hash handler set up when the session begins.
Definition hash.h:65
uint16_t flags
How certain fields are to be interpreted for this session.
Definition hash.h:78
const struct device * device
The device driver instance this crypto context relates to.
Definition hash.h:51
void * drv_sessn_state
If the driver supports multiple simultaneously crypto sessions, this will identify the specific drive...
Definition hash.h:60
Structure encoding IO parameters of a hash operation.
Definition hash.h:88
size_t in_len
Bytes to be operated upon.
Definition hash.h:94
uint8_t * in_buf
Start address of input buffer.
Definition hash.h:91
struct hash_ctx * ctx
Context this packet relates to.
Definition hash.h:107
uint8_t * out_buf
Start of the output buffer, to be allocated by the application.
Definition hash.h:101