2024-12-06 09:07:54 +05:30
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2024-12-11 02:35:26 +05:30
|
|
|
#include "soc/soc_caps.h"
|
2024-12-06 09:07:54 +05:30
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
|
2024-12-11 02:35:26 +05:30
|
|
|
#if defined(CONFIG_IDF_TARGET_ESP32) || !defined(SOC_AES_SUPPORTED)
|
2024-12-06 09:07:54 +05:30
|
|
|
enum AES_TYPE {
|
|
|
|
|
AES_ENC,
|
|
|
|
|
AES_DEC,
|
|
|
|
|
};
|
2024-12-11 02:35:26 +05:30
|
|
|
|
|
|
|
|
#if !SOC_AES_SUPPORTED
|
|
|
|
|
enum AES_BITS {
|
|
|
|
|
AES128,
|
|
|
|
|
AES192,
|
|
|
|
|
AES256
|
|
|
|
|
};
|
|
|
|
|
#endif /* !SOC_AES_SUPPORTED */
|
|
|
|
|
#endif /* CONFIG_IDF_TARGET_ESP32 || !SOC_AES_SUPPORTED */
|
|
|
|
|
|
|
|
|
|
#if SOC_AES_SUPPORTED
|
|
|
|
|
#include "rom/aes.h"
|
2024-12-06 09:07:54 +05:30
|
|
|
|
|
|
|
|
int nvs_bootloader_aes_crypt_ecb(enum AES_TYPE mode,
|
|
|
|
|
const unsigned char *key,
|
|
|
|
|
enum AES_BITS key_bits,
|
|
|
|
|
const unsigned char input[16],
|
|
|
|
|
unsigned char output[16]);
|
2024-12-11 02:35:26 +05:30
|
|
|
|
|
|
|
|
#endif /* SOC_AES_SUPPORTED */
|