Zephyr Project API 4.4.99
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
14#ifndef ZEPHYR_INCLUDE_CRYPTO_HASH_H_
15#define ZEPHYR_INCLUDE_CRYPTO_HASH_H_
16
17
22
23
31
32/* Forward declarations */
33struct hash_ctx;
34struct hash_pkt;
35
36
48typedef int (*hash_op_t)(struct hash_ctx *ctx, struct hash_pkt *pkt,
49 bool finish);
50
57struct hash_ctx {
63 const struct device *device;
64
76
83
89 bool started;
90
100};
101
109struct hash_pkt {
110
116
118 size_t in_len;
119
128
135 struct hash_ctx *ctx;
136};
137
148typedef void (*hash_completion_cb)(struct hash_pkt *completed, int status);
149
150
154#endif /* ZEPHYR_INCLUDE_CRYPTO_HASH_H_ */
void(* hash_completion_cb)(struct hash_pkt *completed, int status)
Handle completion of an asynchronous hash request.
Definition hash.h:148
int(* hash_op_t)(struct hash_ctx *ctx, struct hash_pkt *pkt, bool finish)
Perform a hash operation.
Definition hash.h:48
hash_algo
Hash algorithms.
Definition hash.h:25
@ CRYPTO_HASH_ALGO_SHA256
SHA-256 algorithm.
Definition hash.h:27
@ CRYPTO_HASH_ALGO_SHA512
SHA-512 algorithm.
Definition hash.h:29
@ CRYPTO_HASH_ALGO_SHA224
SHA-224 algorithm.
Definition hash.h:26
@ CRYPTO_HASH_ALGO_SHA384
SHA-384 algorithm.
Definition hash.h:28
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Structure encoding session parameters.
Definition hash.h:57
bool started
Multipart hash operation state.
Definition hash.h:89
hash_op_t hash_hndlr
Hash operation handler selected for this session.
Definition hash.h:82
uint16_t flags
Flags describing how certain fields are interpreted for this session.
Definition hash.h:99
const struct device * device
Device driver instance this crypto context relates to.
Definition hash.h:63
void * drv_sessn_state
Driver-owned session state.
Definition hash.h:75
Structure encoding IO parameters of a hash operation.
Definition hash.h:109
size_t in_len
Number of input bytes to process.
Definition hash.h:118
struct hash_ctx * ctx
Context this packet relates to.
Definition hash.h:135
uint8_t * out_buf
Start address of the output buffer.
Definition hash.h:127
const uint8_t * in_buf
Start address of the input buffer.
Definition hash.h:115