mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-17 11:54:24 +08:00
feat(wpa_supplicant): remove CONFIG_ESP_AES to sync aes internal files with idf but will increase 3k flash size
This commit is contained in:
@ -21,15 +21,11 @@
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifndef CONFIG_ESP_AES
|
||||
|
||||
#include "utils/includes.h"
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "crypto/aes_i.h"
|
||||
#include "crypto.h"
|
||||
#include "aes_i.h"
|
||||
|
||||
|
||||
|
||||
@ -174,41 +170,3 @@ void aes_decrypt_deinit(void *ctx)
|
||||
os_memset(ctx, 0, AES_PRIV_SIZE);
|
||||
os_free(ctx);
|
||||
}
|
||||
|
||||
#else /* CONFIG_ESP_AES */
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_aes.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
void *aes_decrypt_init(const uint8_t *key, size_t len)
|
||||
{
|
||||
int ret;
|
||||
esp_aes_t *ctx;
|
||||
|
||||
ctx = heap_caps_malloc(sizeof(esp_aes_t), MALLOC_CAP_8BIT);
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ret = esp_aes_set_decrypt_key(ctx, key, len * 8);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
return ctx;
|
||||
|
||||
fail:
|
||||
heap_caps_free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void aes_decrypt(void *ctx, const uint8_t *crypt, uint8_t *plain)
|
||||
{
|
||||
esp_aes_decrypt_ecb(ctx, crypt, plain);
|
||||
}
|
||||
|
||||
void aes_decrypt_deinit(void *ctx)
|
||||
{
|
||||
heap_caps_free(ctx);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ESP_AES */
|
||||
|
@ -21,14 +21,10 @@
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifndef CONFIG_ESP_AES
|
||||
|
||||
#include "utils/includes.h"
|
||||
#include "utils/common.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "crypto/aes_i.h"
|
||||
#include "crypto.h"
|
||||
#include "aes_i.h"
|
||||
|
||||
#include "os.h"
|
||||
|
||||
@ -136,41 +132,3 @@ void aes_encrypt_deinit(void *ctx)
|
||||
os_memset(ctx, 0, AES_PRIV_SIZE);
|
||||
os_free(ctx);
|
||||
}
|
||||
|
||||
#else /* CONFIG_ESP_AES */
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_aes.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
void *aes_encrypt_init(const uint8_t *key, size_t len)
|
||||
{
|
||||
int ret;
|
||||
esp_aes_t *ctx;
|
||||
|
||||
ctx = heap_caps_malloc(sizeof(esp_aes_t), MALLOC_CAP_8BIT);
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ret = esp_aes_set_encrypt_key(ctx, key, len * 8);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
return ctx;
|
||||
|
||||
fail:
|
||||
heap_caps_free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void aes_encrypt(void *ctx, const uint8_t *crypt, uint8_t *plain)
|
||||
{
|
||||
esp_aes_encrypt_ecb(ctx, crypt, plain);
|
||||
}
|
||||
|
||||
void aes_encrypt_deinit(void *ctx)
|
||||
{
|
||||
heap_caps_free(ctx);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ESP_AES */
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include "utils/includes.h"
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "crypto/aes_i.h"
|
||||
#include "crypto.h"
|
||||
#include "aes_i.h"
|
||||
|
||||
/*
|
||||
* rijndael-alg-fst.c
|
||||
@ -53,10 +53,6 @@
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifndef CONFIG_ESP_AES
|
||||
|
||||
#define AES_SMALL_TABLES
|
||||
|
||||
/*
|
||||
@ -855,5 +851,3 @@ int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits)
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ESP_AES */
|
||||
|
Reference in New Issue
Block a user