1 /*
2  * Copyright (c) 2019-2022, STMicroelectronics - All Rights Reserved
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef STM32_HASH_H
8 #define STM32_HASH_H
9 
10 #include <stdint.h>
11 
12 enum stm32_hash_algo_mode {
13 #if STM32_HASH_VER == 2
14 	HASH_MD5SUM,
15 #endif
16 	HASH_SHA1,
17 	HASH_SHA224,
18 	HASH_SHA256,
19 #if STM32_HASH_VER == 4
20 	HASH_SHA384,
21 	HASH_SHA512,
22 #endif
23 };
24 
25 int stm32_hash_update(const uint8_t *buffer, size_t length);
26 int stm32_hash_final(uint8_t *digest);
27 int stm32_hash_final_update(const uint8_t *buffer, uint32_t buf_length,
28 			    uint8_t *digest);
29 void stm32_hash_init(enum stm32_hash_algo_mode mode);
30 int stm32_hash_register(void);
31 
32 #endif /* STM32_HASH_H */
33