1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
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
16 #ifdef HKS_CONFIG_FILE
17 #include HKS_CONFIG_FILE
18 #else
19 #include "hks_config.h"
20 #endif
21
22 #include "hks_core_service_key_chipset_platform_derive.h"
23
24 #include <stdbool.h>
25 #include <stddef.h>
26
27 #include "hks_ability.h"
28 #include "dcm_attest.h"
29 #include "hks_auth.h"
30 #include "hks_base_check.h"
31 #include "hks_check_paramset.h"
32 #include "hks_chipset_platform_decrypt.h"
33 #include "hks_client_service_adapter_common.h"
34 #include "hks_cmd_id.h"
35 #include "hks_common_check.h"
36 #include "hks_core_service_three_stage.h"
37 #include "hks_crypto_adapter.h"
38 #include "hks_crypto_hal.h"
39 #include "hks_log.h"
40 #include "hks_mem.h"
41 #include "hks_param.h"
42 #include "hks_secure_access.h"
43 #include "hks_sm_import_wrap_key.h"
44 #include "hks_template.h"
45 #include "hks_type_inner.h"
46 #include "hks_util.h"
47
48 #include "securec.h"
49
50 #ifndef _HARDWARE_ROOT_KEY_
51 #include "hks_rkc.h"
52 #endif
53
54 #ifdef HKS_SUPPORT_CHIPSET_PLATFORM_DECRYPT
HksCoreChipsetPlatformDecrypt(const struct HksParamSet * paramSet,enum HksChipsetPlatformDecryptScene scene,struct HksBlob * plainText)55 int32_t HksCoreChipsetPlatformDecrypt(const struct HksParamSet *paramSet,
56 enum HksChipsetPlatformDecryptScene scene, struct HksBlob *plainText)
57 {
58 return HuksCoreChipsetPlatformDecrypt(paramSet, scene, plainText);
59 }
60
HksCoreExportChipsetPlatformPublicKey(const struct HksBlob * salt,enum HksChipsetPlatformDecryptScene scene,struct HksBlob * publicKey)61 int32_t HksCoreExportChipsetPlatformPublicKey(const struct HksBlob *salt,
62 enum HksChipsetPlatformDecryptScene scene, struct HksBlob *publicKey)
63 {
64 return HuksCoreExportChipsetPlatformPublicKey(salt, scene, publicKey);
65 }
66 #endif