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 PINAUTHTA_VERIFIER_FUNC_H
17 #define PINAUTHTA_VERIFIER_FUNC_H
18 
19 #include "executor_func_common.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif // __cplusplus
24 
25 typedef struct VerifierMsg {
26     uint8_t *msgIn;
27     uint32_t msgInSize;
28     uint8_t *msgOut;
29     uint32_t msgOutSize;
30     bool isAuthEnd;
31     int32_t authResult;
32 } VerifierMsg;
33 
34 ResultCode GenerateVerifierKeyPair(void);
35 void DestroyVerifierKeyPair(void);
36 ResultCode DoGetVerifierExecutorInfo(PinExecutorInfo *pinExecutorInfo);
37 int32_t DoSetVerifierFwkParam(const uint8_t *fwkPubKey, uint32_t fwkPubKeySize);
38 int32_t DoVerifierAuth(uint64_t scheduleId, uint64_t templateId, VerifierMsg *verifierMsg);
39 int32_t DoCancelVerifierAuth();
40 int32_t DoSendMessageToVerifier(uint64_t scheduleId, VerifierMsg *verifierMsg);
41 
42 #ifdef __cplusplus
43 }
44 #endif // __cplusplus
45 #endif // PINAUTHTA_VERIFIER_FUNC_H
46