1 /* 2 * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef _ROM_AES_H_ 8 #define _ROM_AES_H_ 9 10 #include <stdint.h> 11 #include <stdbool.h> 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 #define AES_BLOCK_SIZE 16 18 19 enum AES_TYPE { 20 AES_ENC, 21 AES_DEC, 22 }; 23 24 enum AES_BITS { 25 AES128, 26 AES192, 27 AES256 28 }; 29 30 void ets_aes_enable(void); 31 32 void ets_aes_disable(void); 33 34 int ets_aes_setkey(enum AES_TYPE type, const void *key, enum AES_BITS bits); 35 36 int ets_aes_setkey_enc(const void *key, enum AES_BITS bits); 37 38 int ets_aes_setkey_dec(const void *key, enum AES_BITS bits); 39 40 void ets_aes_block(const void *input, void *output); 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif /* _ROM_AES_H_ */ 47