1 /* 2 // Copyright (C) 2022 Beken Corporation 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef _SEC_H_ 16 #define _SEC_H_ 17 18 #if (CONFIG_SOC_BK7251) 19 20 typedef enum AES_RETURN_E { 21 AES_OK = 0, 22 AES_BUSY, 23 AES_KEYLEN_ERR, 24 } AES_RETURN; 25 26 typedef void (*sec_done_callback)(void *param); 27 struct sec_done_des { 28 sec_done_callback callback; 29 void *param; 30 }; 31 32 int security_aes_busy(void); 33 int security_aes_start(unsigned int mode); 34 int security_aes_init(sec_done_callback callback, void *param); 35 int security_aes_set_key(const unsigned char *key, unsigned int keybits); 36 int security_aes_set_block_data(const unsigned char *block_data); 37 int security_aes_get_result_data(unsigned char *pul_data); 38 #endif //(CONFIG_SOC_BK7251) 39 40 #endif 41 42