1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, Linaro Limited
4  */
5 
6 #ifndef TEE_CRYP_UTL_H
7 #define TEE_CRYP_UTL_H
8 
9 #include <tee_api_types.h>
10 #include <crypto/crypto.h>
11 
12 TEE_Result tee_alg_get_digest_size(uint32_t algo, size_t *size);
13 TEE_Result tee_hash_createdigest(uint32_t algo, const uint8_t *data,
14 				 size_t datalen, uint8_t *digest,
15 				 size_t digestlen);
16 TEE_Result tee_cipher_get_block_size(uint32_t algo, size_t *size);
17 TEE_Result tee_do_cipher_update(void *ctx, uint32_t algo,
18 				TEE_OperationMode mode, bool last_block,
19 				const uint8_t *data, size_t len, uint8_t *dst);
20 
21 /*
22  * plat_prng_add_jitter_entropy() - Adds jitter to RNG entropy pool
23  * @sid:	source ID, normally unique per location of the call
24  * @pnum:	pointer where the pool number for this @sid is stored
25  *
26  * Note that the supplied @sid controls (CRYPTO_RNG_SRC_IS_QUICK()) whether
27  * RPC is allowed to be performed or the event just will be queued for later
28  * consumption.
29  */
30 void plat_prng_add_jitter_entropy(enum crypto_rng_src sid, unsigned int *pnum);
31 
32 void plat_rng_init(void);
33 
34 #endif
35