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 #ifndef MOCK_STORE_HKS_API_H
17 #define MOCK_STORE_HKS_API_H
18
19 #include "hks_type.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 /**
26 * @brief Init operation
27 * @param keyAlias key alias
28 * @param paramSet required parameter set
29 * @param handle operation handle
30 * @param token token
31 * @return error code, see hks_type.h
32 */
HksInit(const struct HksBlob * keyAlias,const struct HksParamSet * paramSet,struct HksBlob * handle,struct HksBlob * token)33 static int32_t HksInit(
34 const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, struct HksBlob *handle, struct HksBlob *token)
35 {
36 return HKS_SUCCESS;
37 }
38
39 /**
40 * @brief Update operation
41 * @param handle operation handle
42 * @param paramSet required parameter set
43 * @param inData the data to update
44 * @param outData output data
45 * @return error code, see hks_type.h
46 */
HksUpdate(const struct HksBlob * handle,const struct HksParamSet * paramSet,const struct HksBlob * inData,struct HksBlob * outData)47 static int32_t HksUpdate(const struct HksBlob *handle, const struct HksParamSet *paramSet,
48 const struct HksBlob *inData, struct HksBlob *outData)
49 {
50 return HKS_SUCCESS;
51 }
52
53 /**
54 * @brief Finish operation
55 * @param handle operation handle
56 * @param paramSet required parameter set
57 * @param inData the data to update
58 * @param outData output data
59 * @return error code, see hks_type.h
60 */
HksFinish(const struct HksBlob * handle,const struct HksParamSet * paramSet,const struct HksBlob * inData,struct HksBlob * outData)61 static int32_t HksFinish(const struct HksBlob *handle, const struct HksParamSet *paramSet,
62 const struct HksBlob *inData, struct HksBlob *outData)
63 {
64 return HKS_SUCCESS;
65 }
66
67 /**
68 * @brief Abort operation
69 * @param handle operation handle
70 * @param paramSet required parameter set
71 * @return error code, see hks_type.h
72 */
HksAbort(const struct HksBlob * handle,const struct HksParamSet * paramSet)73 static int32_t HksAbort(const struct HksBlob *handle, const struct HksParamSet *paramSet)
74 {
75 return HKS_SUCCESS;
76 }
77
78 /**
79 * @brief Generate key
80 * @param keyAlias key alias
81 * @param paramSetIn required parameter set
82 * @param paramSetOut output parameter set
83 * @return error code, see hks_type.h
84 */
HksGenerateKey(const struct HksBlob * keyAlias,const struct HksParamSet * paramSetIn,struct HksParamSet * paramSetOut)85 static int32_t HksGenerateKey(
86 const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut)
87 {
88 return HKS_SUCCESS;
89 }
90
91 /**
92 * @brief Check whether the key exists
93 * @param keyAlias key alias
94 * @param paramSetIn required parameter set
95 * @param paramSetOut output parameter set
96 * @return error code, see hks_type.h
97 */
HksKeyExist(const struct HksBlob * keyAlias,const struct HksParamSet * paramSet)98 static int32_t HksKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet)
99 {
100 return HKS_SUCCESS;
101 }
102
103 #ifdef __cplusplus
104 }
105 #endif
106
107 #endif /* MOCK_STORE_HKS_API_H */
108