1033b5f2a6358ab4cfeba1ffe3d14ef820a67b55
[aaf/sshsm.git] / tpm-util / duplicate / include / util.h
1 /*
2  * Copyright 2018 Intel Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *     Unless required by applicable law or agreed to in writing, software
11  *     distributed under the License is distributed on an "AS IS" BASIS,
12  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *     See the License for the specific language governing permissions and
14  *     limitations under the License.
15  */
16 // Author: Arun Kumar Sekar
17
18 #ifndef __UTIL_H__
19 #define __UTIL_H__
20
21 #include <sapi/tpm20.h>
22 #include <stdlib.h>
23 #include <stdio.h>
24 #include <string.h>
25 #include <limits.h>
26 #include <ctype.h>
27 #include <getopt.h>
28
29
30 void hex_log(UINT8 *pData, UINT32 numBytes, const char* caption);
31
32 TPM_RC ConcatSizedByteBuffer( TPM2B_MAX_BUFFER *result, TPM2B *addBuffer );
33
34 int saveDataToFile(const char *fileName, UINT8 *buf, UINT16 size);
35
36 int loadDataFromFile(const char *fileName, UINT8 *buf, UINT16 *size);
37
38 #endif