1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 * Description: hal hash header. \n 16 * 17 * History: \n 18 * 2023-03-22, Create file. \n 19 */ 20 #ifndef HAL_HASH_H 21 #define HAL_HASH_H 22 23 #include "hal_common.h" 24 #include "crypto_hash_struct.h" 25 26 #ifdef __cplusplus 27 #if __cplusplus 28 extern "C" { 29 #endif /* __cplusplus */ 30 #endif /* __cplusplus */ 31 32 td_s32 hal_cipher_hash_init(td_void); 33 34 td_s32 hal_cipher_hash_deinit(td_void); 35 36 td_s32 hal_hash_lock(td_u32 chn_num); 37 38 td_s32 hal_hash_unlock(td_u32 chn_num); 39 40 td_s32 hal_cipher_hash_config(td_u32 chn_num, crypto_hash_type hash_type, const td_u32 *state); 41 42 td_s32 hal_cipher_hash_attach(td_u32 chn_num, td_u32 keyslot_chn_num); 43 44 td_s32 hal_cipher_hash_add_in_node(td_u32 chn_num, td_phys_addr_t data_phys, td_u32 data_len, 45 in_node_type_e in_node_type); 46 47 td_s32 hal_cipher_hash_start(td_u32 chn_num, td_bool is_wait); 48 49 td_s32 hal_cipher_hash_start_calc(td_u32 chn_num, td_u8 *data, td_u32 length); 50 51 td_s32 hal_cipher_hash_wait_done(td_u32 chn_num, td_u32 *state, td_u32 state_size); 52 53 td_s32 hal_cipher_hash_register_wait_func(td_u32 chn_num, td_void *wait, 54 crypto_wait_timeout_interruptible wait_func, td_u32 timeout_ms); 55 56 td_s32 hal_cipher_hash_done_notify(td_u32 chn_num); 57 58 td_u32 hal_cipher_hash_done_try(td_u32 chn_num); 59 60 td_void hal_hash_debug(td_void); 61 62 td_void hal_hash_debug_chn(td_u32 chn_num); 63 64 td_s32 hal_cipher_hash_wait_func_config(td_u32 chn_num, td_bool is_enable); 65 66 #ifdef __cplusplus 67 #if __cplusplus 68 } 69 #endif /* __cplusplus */ 70 #endif /* __cplusplus */ 71 72 #endif