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 _BK_AES_H_ 16 #define _BK_AES_H_ 17 18 #if (CONFIG_SOC_BK7251) 19 20 enum AES_MODE { 21 AES128 = 0, 22 AES256 = 1, 23 AES192 = 2 24 }; 25 26 enum AES_ENCODE { 27 DECODE = 0, 28 ENCODE = 1 29 }; 30 31 void hal_aes_init(void *ctx); 32 int hal_aes_setkey_dec(void *ctx, const unsigned char *key, 33 unsigned int keybits); 34 int hal_aes_setkey_enc(void *ctx, const unsigned char *key, 35 unsigned int keybits); 36 int hal_aes_crypt_ecb(void *ctx, 37 int mode, 38 const unsigned char input[16], 39 unsigned char output[16]); 40 41 void hal_aes_free(void *ctx); 42 #endif 43 #endif 44 45