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 rkp header. \n 16 * 17 * History: \n 18 * 2023-03-22, Create file. \n 19 */ 20 #ifndef HAL_RKP_H 21 #define HAL_RKP_H 22 23 #include "td_type.h" 24 #include "crypto_km_struct.h" 25 26 #ifdef __cplusplus 27 #if __cplusplus 28 extern "C" { 29 #endif /* __cplusplus */ 30 #endif /* __cplusplus */ 31 32 td_s32 hal_rkp_lock(td_void); 33 34 td_s32 hal_rkp_unlock(td_void); 35 36 td_s32 hal_rkp_deob_update(crypto_kdf_otp_key otp_key, crypto_kdf_update_alg alg); 37 38 td_s32 hal_rkp_kdf_set_val(const td_u8 *kdf_val, td_u32 val_length); 39 40 td_s32 hal_rkp_kdf_get_val(td_u8 *kdf_val, td_u32 val_length); 41 42 td_s32 hal_rkp_kdf_set_padding_salt(const td_u8 *padding_salt, td_u32 salt_length); 43 44 td_s32 hal_rkp_kdf_set_padding_key(const td_u8 *padding_key, td_u32 key_length); 45 46 td_s32 hal_rkp_clear_reg_key(td_void); 47 48 td_s32 hal_rkp_kdf_sw_start(crypto_kdf_sw_alg sw_alg, td_u32 count, td_bool is_wait); 49 50 td_s32 hal_rkp_deob_wait_done(td_void); 51 52 td_s32 hal_rkp_kdf_wait_done(td_void); 53 54 td_s32 hal_rkp_kdf_hard_calculation(const crypto_kdf_hard_calc_param *param); 55 56 td_void hal_rkp_debug(td_void); 57 58 #ifdef __cplusplus 59 #if __cplusplus 60 } 61 #endif /* __cplusplus */ 62 #endif /* __cplusplus */ 63 64 #endif