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
37
55
56
57
61
62
65
74
75
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* ... */
#ifndef _SHA512_ALT_H_
#define _SHA512_ALT_H_
#if defined(MBEDTLS_SHA512_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_SHA512_UNUSED,
ESP_MBEDTLS_SHA512_HARDWARE,
ESP_MBEDTLS_SHA512_SOFTWARE,
}{ ... } esp_mbedtls_sha512_mode;
/* ... */
typedef struct {
uint64_t total[2];
uint64_t state[8];
unsigned char buffer[128];
int is384;
esp_mbedtls_sha512_mode mode;
}{ ... } mbedtls_sha512_context;
/* ... */
#elif SOC_SHA_SUPPORT_DMA || SOC_SHA_SUPPORT_RESUME
typedef enum {
ESP_SHA512_STATE_INIT,
ESP_SHA512_STATE_IN_PROCESS
}{...} esp_sha512_state;
/* ... */
typedef struct {
uint64_t total[2];
uint64_t state[8];
unsigned char buffer[128];
int first_block;
esp_sha_type mode;
uint32_t t_val;
esp_sha512_state sha_state;
}{...} mbedtls_sha512_context;
/* ... */
void esp_sha512_set_mode(mbedtls_sha512_context *ctx, esp_sha_type type);
void esp_sha512_set_t( mbedtls_sha512_context *ctx, uint16_t t_val);
/* ... */
#endif
#endif
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif