Loading...
Searching...
No Matches
psa_hashes.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include "kernel_defines.h"
24#include "psa/crypto.h"
25#include "psa/crypto_contexts.h"
26
27#if IS_USED(MODULE_PSA_HASH_MD5) || defined(DOXYGEN)
35psa_status_t psa_hashes_md5_setup(psa_hashes_md5_ctx_t *ctx);
36
41psa_status_t psa_hashes_md5_update(psa_hashes_md5_ctx_t *ctx,
42 const uint8_t *input,
43 size_t input_length);
44
49psa_status_t psa_hashes_md5_finish(psa_hashes_md5_ctx_t *ctx,
50 uint8_t *hash,
51 size_t hash_size,
52 size_t *hash_length);
53#endif /* MODULE_PSA_HASH_MD5 */
54
55#if IS_USED(MODULE_PSA_HASH_SHA_1) || defined(DOXYGEN)
61
67 const uint8_t *input,
68 size_t input_length);
69
75 uint8_t *hash,
76 size_t hash_size,
77 size_t *hash_length);
78#endif /* MODULE_PSA_HASH_SHA_1 */
79
80#if IS_USED(MODULE_PSA_HASH_SHA_224) || defined(DOXYGEN)
86
92 const uint8_t *input,
93 size_t input_length);
94
100 uint8_t *hash,
101 size_t hash_size,
102 size_t *hash_length);
103#endif /* MODULE_PSA_HASH_SHA_224 */
104
105#if IS_USED(MODULE_PSA_HASH_SHA_256) || defined(DOXYGEN)
111
117 const uint8_t *input,
118 size_t input_length);
119
125 uint8_t *hash,
126 size_t hash_size,
127 size_t *hash_length);
128#endif /* MODULE_PSA_HASH_SHA_256 */
129
130#if IS_USED(MODULE_PSA_HASH_SHA_384) || defined(DOXYGEN)
135psa_status_t psa_hashes_sha384_setup(psa_hashes_sha384_ctx_t *ctx);
136
141psa_status_t psa_hashes_sha384_update(psa_hashes_sha384_ctx_t *ctx,
142 const uint8_t *input,
143 size_t input_length);
144
149psa_status_t psa_hashes_sha384_finish(psa_hashes_sha384_ctx_t *ctx,
150 uint8_t *hash,
151 size_t hash_size,
152 size_t *hash_length);
153#endif /* MODULE_PSA_HASH_SHA_384 */
154
155#if IS_USED(MODULE_PSA_HASH_SHA_512) || defined(DOXYGEN)
161
167 const uint8_t *input,
168 size_t input_length);
169
175 uint8_t *hash,
176 size_t hash_size,
177 size_t *hash_length);
178#endif /* MODULE_PSA_HASH_SHA_512 */
179
180#if IS_USED(MODULE_PSA_HASH_SHA_512_224) || defined(DOXYGEN)
185psa_status_t psa_hashes_sha512_224_setup(psa_hashes_sha512_224_ctx_t *ctx);
186
191psa_status_t psa_hashes_sha512_224_update(psa_hashes_sha512_224_ctx_t *ctx,
192 const uint8_t *input,
193 size_t input_length);
194
199psa_status_t psa_hashes_sha512_224_finish(psa_hashes_sha512_224_ctx_t *ctx,
200 uint8_t *hash,
201 size_t hash_size,
202 size_t *hash_length);
203#endif /* MODULE_PSA_HASH_SHA_512_224 */
204
205#if IS_USED(MODULE_PSA_HASH_SHA_512_256) || defined(DOXYGEN)
210psa_status_t psa_hashes_sha512_256_setup(psa_hashes_sha512_256_ctx_t *ctx);
211
216psa_status_t psa_hashes_sha512_256_update(psa_hashes_sha512_256_ctx_t *ctx,
217 const uint8_t *input,
218 size_t input_length);
219
224psa_status_t psa_hashes_sha512_256_finish(psa_hashes_sha512_256_ctx_t *ctx,
225 uint8_t *hash,
226 size_t hash_size,
227 size_t *hash_length);
228#endif /* MODULE_PSA_HASH_SHA_512_256 */
229
230#if IS_USED(MODULE_PSA_HASH_SHA3_256) || defined(DOXYGEN)
235psa_status_t psa_hashes_sha3_256_update(psa_hashes_sha3_ctx_t *ctx,
236 const uint8_t *input,
237 size_t input_length);
238
243psa_status_t psa_hashes_sha3_256_setup(psa_hashes_sha3_ctx_t *ctx);
244
249psa_status_t psa_hashes_sha3_256_finish(psa_hashes_sha3_ctx_t *ctx,
250 uint8_t *hash);
251#endif /* MODULE_PSA_HASH_SHA3_256 */
252
253#if IS_USED(MODULE_PSA_HASH_SHA3_384) || defined(DOXYGEN)
258psa_status_t psa_hashes_sha3_384_update(psa_hashes_sha3_ctx_t *ctx,
259 const uint8_t *input,
260 size_t input_length);
261
266psa_status_t psa_hashes_sha3_384_setup(psa_hashes_sha3_ctx_t *ctx);
267
272psa_status_t psa_hashes_sha3_384_finish(psa_hashes_sha3_ctx_t *ctx,
273 uint8_t *hash);
274#endif /* MODULE_PSA_HASH_SHA3_384 */
275
276#if IS_USED(MODULE_PSA_HASH_SHA3_512) || defined(DOXYGEN)
281psa_status_t psa_hashes_sha3_512_update(psa_hashes_sha3_ctx_t *ctx,
282 const uint8_t *input,
283 size_t input_length);
284
289psa_status_t psa_hashes_sha3_512_setup(psa_hashes_sha3_ctx_t *ctx);
290
295psa_status_t psa_hashes_sha3_512_finish(psa_hashes_sha3_ctx_t *ctx,
296 uint8_t *hash);
297#endif /* MODULE_PSA_HASH_SHA3_512 */
298
299#ifdef __cplusplus
300}
301#endif
302
Function declarations for PSA Crypto.
Context definitions for PSA Crypto.
psa_status_t psa_hashes_sha384_finish(psa_hashes_sha384_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA384 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha224_setup(psa_hashes_sha224_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA224 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha1_update(psa_hashes_sha1_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA1 hash update See psa_hash_update()
psa_status_t psa_hashes_sha3_512_setup(psa_hashes_sha3_ctx_t *ctx)
Low level wrapper function to call a driver for a SHA3-512 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha3_256_update(psa_hashes_sha3_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for a general SHA3 hash update See psa_hash_update()
psa_status_t psa_hashes_sha512_finish(psa_hashes_sha512_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA512 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha256_update(psa_hashes_sha256_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA256 hash update See psa_hash_update()
psa_status_t psa_hashes_sha1_finish(psa_hashes_sha1_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA1 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha256_finish(psa_hashes_sha256_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA256 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha512_setup(psa_hashes_sha512_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA512 hash setup See psa_hash_setup()
psa_status_t psa_hashes_md5_setup(psa_hashes_md5_ctx_t *ctx)
Low level wrapper function to call a driver for an MD5 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha256_setup(psa_hashes_sha256_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA256 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha512_224_update(psa_hashes_sha512_224_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA512/224 hash update See psa_hash_update()
psa_status_t psa_hashes_sha384_update(psa_hashes_sha384_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA384 hash update See psa_hash_update()
psa_status_t psa_hashes_sha512_update(psa_hashes_sha512_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA512 hash update See psa_hash_update()
psa_status_t psa_hashes_sha3_384_setup(psa_hashes_sha3_ctx_t *ctx)
Low level wrapper function to call a driver for a SHA3-384 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha3_512_update(psa_hashes_sha3_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for a general SHA3 hash update See psa_hash_update()
psa_status_t psa_hashes_sha3_256_finish(psa_hashes_sha3_ctx_t *ctx, uint8_t *hash)
Low level wrapper function to call a driver for a SHA3-256 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha512_224_setup(psa_hashes_sha512_224_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA512/224 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha3_512_finish(psa_hashes_sha3_ctx_t *ctx, uint8_t *hash)
Low level wrapper function to call a driver for a SHA3-512 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha384_setup(psa_hashes_sha384_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA384 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha512_256_finish(psa_hashes_sha512_256_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA512/256 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha3_384_finish(psa_hashes_sha3_ctx_t *ctx, uint8_t *hash)
Low level wrapper function to call a driver for a SHA3-384 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha224_finish(psa_hashes_sha224_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA224 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha3_384_update(psa_hashes_sha3_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for a general SHA3 hash update See psa_hash_update()
psa_status_t psa_hashes_sha512_256_setup(psa_hashes_sha512_256_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA512/256 hash setup See psa_hash_setup()
psa_status_t psa_hashes_sha224_update(psa_hashes_sha224_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA224 hash update See psa_hash_update()
psa_status_t psa_hashes_sha3_256_setup(psa_hashes_sha3_ctx_t *ctx)
Low level wrapper function to call a driver for a SHA3-256 hash setup See psa_hash_setup()
psa_status_t psa_hashes_md5_update(psa_hashes_md5_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an MD5 hash update See psa_hash_update()
psa_status_t psa_hashes_sha512_224_finish(psa_hashes_sha512_224_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an SHA512/224 hash finish See psa_hash_finish()
psa_status_t psa_hashes_md5_finish(psa_hashes_md5_ctx_t *ctx, uint8_t *hash, size_t hash_size, size_t *hash_length)
Low level wrapper function to call a driver for an MD5 hash finish See psa_hash_finish()
psa_status_t psa_hashes_sha512_256_update(psa_hashes_sha512_256_ctx_t *ctx, const uint8_t *input, size_t input_length)
Low level wrapper function to call a driver for an SHA512/256 hash update See psa_hash_update()
psa_status_t psa_hashes_sha1_setup(psa_hashes_sha1_ctx_t *ctx)
Low level wrapper function to call a driver for an SHA1 hash setup See psa_hash_setup()
Common macros and compiler attributes/pragmas configuration.
int32_t psa_status_t
Status code type used for all PSA Certified APIs.
Definition error.h:37
CRYS_HASHUserContext_t psa_hashes_sha224_ctx_t
Map driver specific SHA224 context to PSA context.
CRYS_HASHUserContext_t psa_hashes_sha256_ctx_t
Map driver specific SHA256 context to PSA context.
CRYS_HASHUserContext_t psa_hashes_sha512_ctx_t
Map driver specific SHA512 context to PSA context.
CRYS_HASHUserContext_t psa_hashes_sha1_ctx_t
Map driver specific SHA1 context to PSA context.