1 /*
2  * Copyright (c) 2024-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 HKS_FUZZ_UTIL_H
17 #define HKS_FUZZ_UTIL_H
18 
19 #include <vector>
20 #include <cstdio>
21 
22 // import WrapParamSet
23 #include "base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/hks_chipset_platform_test.h"
24 
25 namespace OHOS {
26 namespace Security {
27 namespace Hks {
28 template<typename ReadType>
ReadData(uint8_t * & data,size_t & size,uint32_t readSize)29 inline ReadType ReadData(uint8_t *&data, size_t &size, uint32_t readSize)
30 {
31     ReadType read = reinterpret_cast<ReadType>(data);
32     data += readSize;
33     size -= readSize;
34     return read;
35 }
36 
37 [[maybe_unused]] WrapParamSet ConstructHksParamSetFromFuzz(uint8_t *&data, size_t &size);
38 }}}
39 
40 #endif // HKS_FUZZ_UTIL_H
41