Android-cuttlefish cvd tool
tpm_hmac.h
Go to the documentation of this file.
1//
2// Copyright (C) 2020 The Android Open Source Project
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#pragma once
17
18#include <memory>
19#include <string>
20
21#include <tss2/tss2_esys.h>
22
24
25namespace cuttlefish {
26
27class TpmResourceManager;
28
30 void operator()(void* data) { Esys_Free(data); }
31};
32
33template<typename T>
34using UniqueEsysPtr = std::unique_ptr<T, EsysDeleter>;
35
50 TpmResourceManager& resource_manager,
51 ESYS_TR key_handle,
52 TpmAuth auth,
53 const uint8_t* data,
54 size_t data_size);
55
61 TpmResourceManager& resource_manager, const std::string& context,
62 const uint8_t* data, size_t data_size);
63
64} // namespace cuttlefish
Definition: tpm_auth.h:32
Definition: tpm_resource_manager.h:50
char data[Size]
Definition: incremental_server.cpp:1
Definition: alloc_utils.cpp:23
std::unique_ptr< T, EsysDeleter > UniqueEsysPtr
Definition: tpm_hmac.h:34
UniqueEsysPtr< TPM2B_DIGEST > TpmHmacWithContext(TpmResourceManager &resource_manager, const std::string &context, const uint8_t *data, size_t data_size)
Definition: tpm_hmac.cpp:139
UniqueEsysPtr< TPM2B_DIGEST > TpmHmac(TpmResourceManager &resource_manager, ESYS_TR key_handle, TpmAuth auth, const uint8_t *data, size_t data_size)
Definition: tpm_hmac.cpp:128
Definition: tpm_hmac.h:29
void operator()(void *data)
Definition: tpm_hmac.h:30