.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "TPM_IO_Hash_Start 3" .TH TPM_IO_Hash_Start 3 2026-01-02 libtpms "" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME TPM_IO_Hash_Start \- indicate the beginging of a TPM TIS hash operation .PP TPM_IO_Hash_Data \- hash the provided data .PP TPM_IO_Hash_End \- indicate the end of a TPM TIS hash operation .SH LIBRARY .IX Header "LIBRARY" TPM library (libtpms, \-ltpms) .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include .PP \&\fB#include .PP \&\fB#include .PP \&\fBTPM_RESULT TPM_IO_Hash_Start(void);\fR .PP \&\fBTPM_RESULT TPM_IO_Hash_Data(const unsigned char\fR *\fIdata\fR\fB, uint32_t\fR \fIdata_length\fR\fB);\fR .PP \&\fBTPM_RESULT TPM_IO_Hash_End(void);\fR .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBTPM_IO_Hash_Start()\fR function can be used by an implementation of the TPM TIS hardware interface to indicate the beginning of a hash operation. Following the TPM TIS interface specification it resets several PCRs and terminates existing transport sessions. The \fBTPM_IO_Hash_Data()\fR function is used to send the data to be hashed to the TPM. The \fBTPM_IO_Hash_End()\fR function calculates the final hash and stores it in the locality 4 PCR. The 3 functions must be called in the order they were explained. .PP The implementation of the above functions handles all TPM\-internal actions such as the setting and clearing of permanent flags and PCRs and the calculation of the hash. Any functionality related to the TPM\*(Aqs TIS interface and the handling of flags, locality and state has to be implemented by the caller. .SH ERRORS .IX Header "ERRORS" .IP \fBTPM_SUCCESS\fR 4 .IX Item "TPM_SUCCESS" The function completed successfully. .IP \fBTPM_FAIL\fR 4 .IX Item "TPM_FAIL" General failure. .IP \fBTPM_INVALID_POSTINIT\fR 4 .IX Item "TPM_INVALID_POSTINIT" The \fBTPM_IO_Hash_Start()\fR function was called before the TPM received a TPM_Startup command. .IP \fBTPM_SHA_THREAD\fR 4 .IX Item "TPM_SHA_THREAD" The \fBTPM_IO_Hash_Data()\fR or \fBTPM_IO_Hash_End()\fR functions were called before the \fBTPM_IO_Hash_Start()\fR function. .PP For a complete list of TPM error codes please consult the include file \&\fBlibtpms/tpm_error.h\fR .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3), \&\fBTPMLIB_Process\fR(3)