mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-27 04:09:59 +08:00
feat(util): Add extra SHA and unit test
1. wpa_supplicatn use extra SHA default 2. mbedtls use extra SHA default 3. bootloader use extra SHA default 4. user code can use extra SHA default Above all, using unified module is easy to maintenance code and save rom or ram.
This commit is contained in:
@ -15,6 +15,17 @@
|
||||
#ifndef SHA1_I_H
|
||||
#define SHA1_I_H
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef CONFIG_ESP_SHA
|
||||
#include "esp_sha.h"
|
||||
|
||||
typedef esp_sha_t SHA1_CTX;
|
||||
|
||||
#define SHA1Init(_sha) esp_sha1_init(_sha)
|
||||
#define SHA1Update(_sha, _s, _l) esp_sha1_update(_sha, _s, _l)
|
||||
#define SHA1Final(_d, _sha) esp_sha1_finish(_sha, _d)
|
||||
#else /* CONFIG_ESP_SHA */
|
||||
struct SHA1Context {
|
||||
u32 state[5];
|
||||
u32 count[2];
|
||||
@ -25,5 +36,6 @@ void SHA1Init(struct SHA1Context *context);
|
||||
void SHA1Update(struct SHA1Context *context, const void *data, u32 len);
|
||||
void SHA1Final(unsigned char digest[20], struct SHA1Context *context);
|
||||
void SHA1Transform(u32 state[5], const unsigned char buffer[64]);
|
||||
#endif /* CONFIG_ESP_SHA */
|
||||
|
||||
#endif /* SHA1_I_H */
|
||||
|
Reference in New Issue
Block a user