1 /*
2  * Copyright (C) 2021 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 ISO_TASK_COMMON_H
17 #define ISO_TASK_COMMON_H
18 
19 #include "json_utils.h"
20 #include "iso_base_cur_task.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 void DestroyIsoParams(IsoParams *params);
27 int InitIsoParams(IsoParams *params, const CJson *in);
28 
29 int GenerateSeed(IsoParams *params);
30 
31 int GenerateKeyAliasInIso(const IsoParams *params, uint8_t *keyAlias, uint32_t keyAliasLen, bool useOpposite);
32 int GeneratePsk(const CJson *in, IsoParams *params);
33 
34 int GenerateEncResult(const IsoParams *params, int message, CJson *sendToPeer, const char *aad);
35 int GenEncResult(IsoParams *params, int message, CJson *out, const char *aad, bool isNeedReturnKey);
36 int SendResultToFinalSelf(IsoParams *params, CJson *out, bool isNeedReturnKey);
37 int CheckEncResult(IsoParams *params, const CJson *in, const char *aad);
38 void DeleteAuthCode(const IsoParams *params);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 #endif
44