Esys_ZGen_2Phase(3)

πŸ’œ Esys_ZGen_2Phase β€” the TPM2_ZGen_2Phase ESAPI glow-up πŸ’œ

okay so bestie, this page lives in the Library Functions Manual for tpm2-tss, and it's literally all about Esys_ZGen_2Phase(3) β€” the ESAPI function that calls the TPM2_ZGen_2Phase command. no cap, that's the whole vibe. πŸ¦‹


✨ NAME ✨

Esys_ZGen_2Phase β€” the ESAPI function for the TPM2_ZGen_2Phase command. that's it, that's the name, she's iconic πŸ’…


🌸 SYNOPSIS 🌸

πŸŽ€ Functions πŸŽ€

TSS2_RC Esys_ZGen_2Phase_Async (ESYS_CONTEXT *esysContext, ESYS_TR keyA,
    ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const
    TPM2B_ECC_POINT *inQsB, const TPM2B_ECC_POINT *inQeB,
    TPMI_ECC_KEY_EXCHANGE inScheme, UINT16 counter)
TSS2_RC Esys_ZGen_2Phase (ESYS_CONTEXT *esysContext, ESYS_TR keyA,
    ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const
    TPM2B_ECC_POINT *inQsB, const TPM2B_ECC_POINT *inQeB,
    TPMI_ECC_KEY_EXCHANGE inScheme, UINT16 counter, TPM2B_ECC_POINT
    **outZ1, TPM2B_ECC_POINT **outZ2)
TSS2_RC Esys_ZGen_2Phase_Finish (ESYS_CONTEXT *esysContext,
    TPM2B_ECC_POINT **outZ1, TPM2B_ECC_POINT **outZ2)

πŸ’« Detailed Description πŸ’«

okay so real talk: this is the ESAPI function you use to invoke the TPM2_ZGen_2Phase command β€” and you've got options, bestie. you can do it as a one-call situation (blocking, simple, cute) or in an asynchronous manner (fire it off and come back later, main character energy). ✨


πŸ”₯ Function Documentation πŸ”₯

🧚 TSS2_RC Esys_ZGen_2Phase (ESYS_CONTEXT * esysContext, ESYS_TR keyA, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_ECC_POINT * inQsB, const TPM2B_ECC_POINT * inQeB, TPMI_ECC_KEY_EXCHANGE inScheme, UINT16 counter, TPM2B_ECC_POINT ** outZ1, TPM2B_ECC_POINT ** outZ2) 🧚

One-Call function for TPM2_ZGen_2Phase β€” the "just do it all in one go" version. πŸ’–

this function invokes the TPM2_ZGen_2Phase command in a one-call variant. what that means: the function will block until the TPM response is available, so like, sit tight, she's working on it. 😭 all input parameters are const. and the memory for non-simple output parameters is allocated by the function implementation β€” so the callee's got you, you don't have to malloc anything yourself. periodt.

🫢 Parameters 🫢

  • esysContext β€” The ESYS_CONTEXT.
  • keyA β€” handle of an unrestricted decryption key ECC.
  • shandle1 β€” session handle for authorization of keyA.
  • shandle2 β€” second session handle.
  • shandle3 β€” third session handle.
  • inQsB β€” other party's static public key (Qs,B = (Xs,B, Ys,B)).
  • inQeB β€” other party's ephemeral public key (Qe,B = (Xe,B, Ye,B)).
  • inScheme β€” the key exchange scheme.
  • counter β€” value returned by TPM2_EC_Ephemeral().
  • outZ1 β€” X and Y coordinates of the computed value (scheme dependent). (callee-allocated)
  • outZ2 β€” X and Y coordinates of the second computed value (scheme dependent). (callee-allocated)

πŸ’€ Return values πŸ’€

  • TSS2_RC_SUCCESS β€” if the function call was a success. slay. βœ…
  • TSS2_ESYS_RC_BAD_REFERENCE β€” if the esysContext or required input pointers or required output handle references are NULL.
  • TSS2_ESYS_RC_BAD_CONTEXT β€” if esysContext corruption is detected. 🚨
  • TSS2_ESYS_RC_MEMORY β€” if the ESAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_ESYS_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending. one thing at a time, bestie.
  • TSS2_ESYS_RC_INSUFFICIENT_RESPONSE β€” if the TPM's response does not at least contain the tag, response length, and response code.
  • TSS2_ESYS_RC_MALFORMED_RESPONSE β€” if the TPM's response is corrupted. πŸ’€
  • TSS2_ESYS_RC_RSP_AUTH_FAILED β€” if the response HMAC from the TPM did not verify.
  • TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONS β€” if more than one session has the 'decrypt' attribute bit set.
  • TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONS β€” if more than one session has the 'encrypt' attribute bit set.
  • TSS2_ESYS_RC_BAD_TR β€” if any of the ESYS_TR objects are unknown to the ESYS_CONTEXT or are of the wrong type or if required ESYS_TR objects are ESYS_TR_NONE.
  • TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally. (iykyk) πŸŒ€

🌈 TSS2_RC Esys_ZGen_2Phase_Async (ESYS_CONTEXT * esysContext, ESYS_TR keyA, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_ECC_POINT * inQsB, const TPM2B_ECC_POINT * inQeB, TPMI_ECC_KEY_EXCHANGE inScheme, UINT16 counter) 🌈

Asynchronous function for TPM2_ZGen_2Phase β€” the "text you later" version. πŸ¦‹

this function invokes the TPM2_ZGen_2Phase command in an asynchronous variant. translation: the function will return as soon as the command has been sent downwards the stack to the TPM β€” she does not wait around. ✨ all input parameters are const. and in order to retrieve the TPM's response, you call Esys_ZGen_2Phase_Finish. don't forget, bestie, or you'll just be standing there with no results 😭

🫢 Parameters 🫢

  • esysContext β€” The ESYS_CONTEXT.
  • keyA β€” handle of an unrestricted decryption key ECC.
  • shandle1 β€” session handle for authorization of keyA.
  • shandle2 β€” second session handle.
  • shandle3 β€” third session handle.
  • inQsB β€” other party's static public key (Qs,B = (Xs,B, Ys,B)).
  • inQeB β€” other party's ephemeral public key (Qe,B = (Xe,B, Ye,B)).
  • inScheme β€” the key exchange scheme.
  • counter β€” value returned by TPM2_EC_Ephemeral().

πŸ’€ Return values πŸ’€

  • ESYS_RC_SUCCESS β€” if the function call was a success. βœ…
  • TSS2_ESYS_RC_BAD_REFERENCE β€” if the esysContext or required input pointers or required output handle references are NULL.
  • TSS2_ESYS_RC_BAD_CONTEXT β€” if esysContext corruption is detected. 🚨
  • TSS2_ESYS_RC_MEMORY β€” if the ESAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.
  • TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONS β€” if more than one session has the 'decrypt' attribute bit set.
  • TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONS β€” if more than one session has the 'encrypt' attribute bit set.
  • TSS2_ESYS_RC_BAD_TR β€” if any of the ESYS_TR objects are unknown to the ESYS_CONTEXT or are of the wrong type or if required ESYS_TR objects are ESYS_TR_NONE.

⭐ TSS2_RC Esys_ZGen_2Phase_Finish (ESYS_CONTEXT * esysContext, TPM2B_ECC_POINT ** outZ1, TPM2B_ECC_POINT ** outZ2) ⭐

Asynchronous finish function for TPM2_ZGen_2Phase β€” the "okay come back, here's your stuff" moment. πŸ’–

this function returns the results of a TPM2_ZGen_2Phase command invoked via Esys_ZGen_2Phase_Finish. all non-simple output parameters are allocated by the function's implementation. and here's the cute part: NULL can be passed for every output parameter if the value is not required β€” so if you don't care about a value, just pass NULL and move on with your life. πŸ™ˆ

🫢 Parameters 🫢

  • esysContext β€” The ESYS_CONTEXT.
  • outZ1 β€” X and Y coordinates of the computed value (scheme dependent). (callee-allocated)
  • outZ2 β€” X and Y coordinates of the second computed value (scheme dependent). (callee-allocated)

πŸ’€ Return values πŸ’€

  • TSS2_RC_SUCCESS β€” on success. βœ…
  • ESYS_RC_SUCCESS β€” if the function call was a success. βœ… (yes bestie, she's listed twice, that's just how the page is πŸ’…)
  • TSS2_ESYS_RC_BAD_REFERENCE β€” if the esysContext or required input pointers or required output handle references are NULL.
  • TSS2_ESYS_RC_BAD_CONTEXT β€” if esysContext corruption is detected. 🚨
  • TSS2_ESYS_RC_MEMORY β€” if the ESAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_ESYS_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • TSS2_ESYS_RC_TRY_AGAIN β€” if the timeout counter expires before the TPM response is received. ⏳
  • TSS2_ESYS_RC_INSUFFICIENT_RESPONSE β€” if the TPM's response does not at least contain the tag, response length, and response code.
  • TSS2_ESYS_RC_RSP_AUTH_FAILED β€” if the response HMAC from the TPM did not verify.
  • TSS2_ESYS_RC_MALFORMED_RESPONSE β€” if the TPM's response is corrupted. πŸ’€
  • TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.
ngl the return-value lists are long, but every single one of those codes matters β€” don't skip the vibe check on error handling, bestie 🫢

πŸ‘‘ Author πŸ‘‘

generated automatically by Doxygen for tpm2-tss from the source code. she wrote herself, honestly iconic of her. πŸŽ€


so yeah, that's the page πŸ’… β€” brought to you by tpm2-tss, Version 4.1.5, dated the day she shipped. go forth and call your TPM, bestie, you've got this πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from