1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
53
54
71
72
73
74
75
76
77
78
79
/* ... */
#ifndef _SHA256_ALT_H_
#define _SHA256_ALT_H_
#if defined(MBEDTLS_SHA256_ALT)
#include "hal/sha_types.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
#if SOC_SHA_SUPPORT_PARALLEL_ENG
typedef enum {
ESP_MBEDTLS_SHA256_UNUSED,
ESP_MBEDTLS_SHA256_HARDWARE,
ESP_MBEDTLS_SHA256_SOFTWARE,
}{ ... } esp_mbedtls_sha256_mode;
/* ... */
typedef struct {
uint32_t total[2];
uint32_t state[8];
unsigned char buffer[64];
int is224;
esp_mbedtls_sha256_mode mode;
}{ ... } mbedtls_sha256_context;
/* ... */
#elif SOC_SHA_SUPPORT_DMA || SOC_SHA_SUPPORT_RESUME
typedef enum {
ESP_SHA256_STATE_INIT,
ESP_SHA256_STATE_IN_PROCESS
}{...} esp_sha256_state;
/* ... */
typedef struct {
uint32_t total[2];
uint32_t state[8];
unsigned char buffer[64];
int first_block;
esp_sha_type mode;
esp_sha256_state sha_state;
}{...} mbedtls_sha256_context;
/* ... */
#endif
#endif
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif