mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-10 09:55:47 +00:00
crypto: SHA and AES accelerator bring up for S2
Brings up, fixes and enables AES and SHA hardware acceleration. Closes IDF-714 Closes IDF-716
This commit is contained in:
@@ -29,6 +29,30 @@ extern "C" {
|
||||
|
||||
#if defined(MBEDTLS_SHA1_ALT)
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S2
|
||||
|
||||
#include "esp32s2/sha.h"
|
||||
typedef enum {
|
||||
ESP_SHA1_STATE_INIT,
|
||||
ESP_SHA1_STATE_IN_PROCESS
|
||||
} esp_sha1_state;
|
||||
|
||||
/**
|
||||
* \brief SHA-1 context structure
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t total[2]; /*!< number of bytes processed */
|
||||
uint32_t state[5]; /*!< intermediate digest state */
|
||||
unsigned char buffer[64]; /*!< data block being processed */
|
||||
int first_block; /*!< if first then true else false */
|
||||
esp_sha_type mode;
|
||||
esp_sha1_state sha_state;
|
||||
} mbedtls_sha1_context;
|
||||
|
||||
#endif //CONFIG_IDF_TARGET_ESP32S2
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
typedef enum {
|
||||
ESP_MBEDTLS_SHA1_UNUSED, /* first block hasn't been processed yet */
|
||||
ESP_MBEDTLS_SHA1_HARDWARE, /* using hardware SHA engine */
|
||||
@@ -38,8 +62,7 @@ typedef enum {
|
||||
/**
|
||||
* \brief SHA-1 context structure
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
uint32_t total[2]; /*!< number of bytes processed */
|
||||
uint32_t state[5]; /*!< intermediate digest state */
|
||||
unsigned char buffer[64]; /*!< data block being processed */
|
||||
@@ -47,6 +70,8 @@ typedef struct
|
||||
}
|
||||
mbedtls_sha1_context;
|
||||
|
||||
#endif //CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user