Mbed OS Reference
Loading...
Searching...
No Matches
hash_stm32.h
1/**
2 ******************************************************************************
3 * @brief Header file of mbed TLS HW crypto (HASH) implementation.
4 ******************************************************************************
5 * @attention
6 *
7 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
8 * SPDX-License-Identifier: Apache-2.0
9 * Copyright (C) 2019 STMicroelectronics, All Rights Reserved
10 *
11 * This software component is licensed by ST under Apache 2.0 license,
12 * the "License"; You may not use this file except in compliance with the
13 * License. You may obtain a copy of the License at:
14 * https://opensource.org/licenses/Apache-2.0
15 *
16 ******************************************************************************
17 */
18
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef __HASH_H
21#define __HASH_H
22
23#if defined(MBEDTLS_SHA1_ALT) || defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_MD5_ALT)
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include "cmsis.h"
31
32#if defined(MBEDTLS_THREADING_C)
33#include "mbedtls/threading.h"
34#endif
35
36/* macros --------------------------------------------------------------------*/
37/* constants -----------------------------------------------------------------*/
38#define ST_HASH_TIMEOUT ((uint32_t) 1000) /* TO in ms for the hash processor */
39
40/* defines -------------------------------------------------------------------*/
41/* variables -----------------------------------------------------------------*/
42#if defined(MBEDTLS_THREADING_C)
43extern mbedtls_threading_mutex_t hash_mutex;
44extern unsigned char hash_mutex_started;
45#endif /* MBEDTLS_THREADING_C */
46
47extern unsigned int hash_context_count;
48
49/* functions prototypes ------------------------------------------------------*/
50extern void hash_zeroize(void *v, size_t n);
51
52#ifdef __cplusplus
53}
54#endif
55
56#endif /* MBEDTLS_SHA1_ALT or MBEDTLS_SHA256_ALT or MBEDTLS_MD5_ALT */
57#endif /*__HASH_H */
Threading abstraction layer.