1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef CRYPTO_ALG_CONFIG_H 13 #define CRYPTO_ALG_CONFIG_H 14 15 #include <tee_defines.h> 16 17 bool crypto_check_alg_valid(uint32_t alg, uint32_t mode); 18 uint32_t crypto_get_op_class(uint32_t alg); 19 TEE_Result crypto_check_keysize(uint32_t algorithm, uint32_t max_key_size); 20 bool crypto_check_keytype_valid(uint32_t algo, uint32_t type); 21 bool crypto_check_alg_supported(uint32_t alg, uint32_t element); 22 bool crypto_object_type_supported(uint32_t object_type); 23 TEE_Result check_if_unsafe_alg(uint32_t alg, uint32_t key_size); 24 TEE_Result check_if_unsafe_type(uint32_t obj_type, uint32_t key_size); 25 #endif 26