Tspi_Hash_SetHashValue(3)

πŸ’– Tspi_Hash_SetHashValue(3) πŸ’–

okay bestie, so this is a page from the TCG Software Stack Developer's Reference β€” it lives in the Library Functions Manual section, and it's about giving your hash object an actual hash value. non-SHA1 girlies, this one's for you 🫢


✨ NAME ✨

Tspi_Hash_SetHashValue β€” sets the hash value of a hash object for non-SHA1 hash objects. yes, it's giving "put the value in the thing". iconic behaviour honestly πŸ’…


🌸 SYNOPSIS 🌸

#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>

TSS_RESULT Tspi_Hash_SetHashValue(TSS_HHASH hHash, UINT32 ulHashValueLength, BYTE* rgbHashValue);

like, yes, all seven includes. the whole skincare routine. don't skip a step 🧚


πŸ’œ DESCRIPTION πŸ’œ

So Tspi_Hash_SetHashValue sets the hash value of a hash object. That's the whole job. She's a one-task queen and she ate πŸ”₯

But here's the tea, and it matters: if the object was created with the flag TSS_HASH_OTHER, then the hash identifier has to be set by calling Tspi_SetAttribData to perform the sign operation. so if you're on the TSS_HASH_OTHER path and you skip that step, the sign operation just… won't. no cap. set the identifier first, bestie 😭


πŸŽ€ PARAMETERS πŸŽ€

hHash

The handle to the hash object instance whose hash value should be signed. like, the little guy you're working on ✨

ulHashValueLength

Indicates the length of the hash value data provided at the parameter rgbHashValue. yes, you gotta tell her how long the data is. she's not a mind reader πŸ’€

rgbHashValue

A pointer to the hash value data. that's it. that's the data. point at it πŸ‘‘


🌈 RETURN CODES 🌈

Tspi_Hash_SetHashValue returns TSS_SUCCESS on success β€” slay β€” otherwise one of the following values is returned:

  • TSS_E_INVALID_HANDLE β€” hHash is not a valid handle. she does not know her. πŸ™ˆ
  • TSS_E_INTERNAL_ERROR β€” An internal SW error has been detected. not your fault, lowkey, but still a problem πŸ’€
  • TSS_E_BAD_PARAMETER β€” One or more parameters is bad. one of y'all is misbehaving and she's calling it out 😭
  • TSS_E_HASH_INVALID_LENGTH β€” Hash length is inconsistent with hash algorithm. the length doesn't match the algorithm, and that's a vibe check fail.
  • TSS_E_HASH_NO_DATA β€” Hash object has no internal hash value. she's empty. nothing in there. girl where's the data πŸ’…

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Hash_SetHashValue conforms to the Trusted Computing Group Software Specification version 1.1 Golden. Golden!! like, literally the gold standard, main character energy ⭐


πŸ¦‹ SEE ALSO πŸ¦‹

go read the rest of the friend group, they all hang out together 🫢


🌸 and that's the page!! TSS 1.1 energy, dated 2004-05-25 β€” an absolute vintage icon, and she's still serving. mwah πŸ’‹πŸ’–βœ¨