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