1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 3 #pragma once 4 5 #include "tpm2-util.h" 6 7 struct crypt_device; 8 9 int acquire_luks2_key( 10 uint32_t pcr_mask, 11 uint16_t pcr_bank, 12 uint16_t primary_alg, 13 const char *device, 14 const void *key_data, 15 size_t key_data_size, 16 const void *policy_hash, 17 size_t policy_hash_size, 18 TPM2Flags flags, 19 void **ret_decrypted_key, 20 size_t *ret_decrypted_key_size); 21 22 int parse_luks2_tpm2_data( 23 const char *json, 24 uint32_t search_pcr_mask, 25 uint32_t *ret_pcr_mask, 26 uint16_t *ret_pcr_bank, 27 uint16_t *ret_primary_alg, 28 char **ret_base64_blob, 29 char **ret_hex_policy_hash, 30 TPM2Flags *ret_flags); 31