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(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet,
34     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 Generate key
69  * @param keyAlias key alias
70  * @param paramSetIn required parameter set
71  * @param paramSetOut output parameter set
72  * @return error code, see hks_type.h
73  */
HksGenerateKey(const struct HksBlob * keyAlias,const struct HksParamSet * paramSetIn,struct HksParamSet * paramSetOut)74 static int32_t HksGenerateKey(const struct HksBlob *keyAlias,
75     const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut)
76 {
77     return HKS_SUCCESS;
78 }
79 
80 /**
81  * @brief Check whether the key exists
82  * @param keyAlias key alias
83  * @param paramSetIn required parameter set
84  * @param paramSetOut output parameter set
85  * @return error code, see hks_type.h
86  */
HksKeyExist(const struct HksBlob * keyAlias,const struct HksParamSet * paramSet)87 static int32_t HksKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet)
88 {
89     return HKS_SUCCESS;
90 }
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* MOCK_STORE_HKS_API_H */
97