1 /* 2 ROM functions for hardware AES support. 3 4 It is not recommended to use these functions directly, 5 use the wrapper functions in esp32/aes.h instead. 6 7 */ 8 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 9 // 10 // Licensed under the Apache License, Version 2.0 (the "License"); 11 // you may not use this file except in compliance with the License. 12 // You may obtain a copy of the License at 13 14 // http://www.apache.org/licenses/LICENSE-2.0 15 // 16 // Unless required by applicable law or agreed to in writing, software 17 // distributed under the License is distributed on an "AS IS" BASIS, 18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 // See the License for the specific language governing permissions and 20 // limitations under the License. 21 22 #ifndef _ROM_AES_H_ 23 #define _ROM_AES_H_ 24 25 #include <stdint.h> 26 #include <stdbool.h> 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 //TODO, add comment for aes apis 33 enum AES_BITS { 34 AES128, 35 AES192, 36 AES256 37 }; 38 39 void ets_aes_enable(void); 40 41 void ets_aes_disable(void); 42 43 void ets_aes_set_endian(bool key_word_swap, bool key_byte_swap, 44 bool in_word_swap, bool in_byte_swap, 45 bool out_word_swap, bool out_byte_swap); 46 47 bool ets_aes_setkey_enc(const uint8_t *key, enum AES_BITS bits); 48 49 bool ets_aes_setkey_dec(const uint8_t *key, enum AES_BITS bits); 50 51 void ets_aes_crypt(const uint8_t input[16], uint8_t output[16]); 52 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #endif /* _ROM_AES_H_ */ 58