F-6842 - Share TPM2_XOR_MASK_MAX via header so test matches impl

pull/551/head
aidan garske 2026-07-13 12:54:21 -07:00
parent 2ef42a0151
commit 14d02a32b2
3 changed files with 6 additions and 10 deletions

View File

@ -57,13 +57,6 @@
/* --- Param Enc/Dec Functions -- */
/******************************************************************************/
/* Maximum XOR mask size. RSA-2048 inSensitive parameter blobs on Create can
* exceed MAX_DIGEST_BUFFER (1024), so leave headroom to ~1250 bytes. Keep
* stack usage bounded by switching to heap under WOLFTPM_SMALL_STACK. */
#ifndef TPM2_XOR_MASK_MAX
#define TPM2_XOR_MASK_MAX 1280
#endif
/* XOR parameter encryption/decryption (shared by client and fwTPM).
* XOR is symmetric so encrypt and decrypt are the same operation.
* nonceA/nonceB order determines direction (caller/TPM or TPM/caller). */

View File

@ -1923,9 +1923,6 @@ static void test_TPM2_ParamEnc_XOR_Vector(void)
#endif
}
#ifndef TPM2_XOR_MASK_MAX
#define TPM2_XOR_MASK_MAX 1280
#endif
static void test_TPM2_ParamEnc_XOR_MaskBoundary(void)
{
#ifndef WOLFTPM2_NO_WOLFCRYPT

View File

@ -30,6 +30,12 @@
extern "C" {
#endif
/* Maximum XOR mask size. RSA-2048 inSensitive parameter blobs on Create can
* exceed MAX_DIGEST_BUFFER (1024), so leave headroom to ~1250 bytes. */
#ifndef TPM2_XOR_MASK_MAX
#define TPM2_XOR_MASK_MAX 1280
#endif
/* XOR parameter encryption/decryption (raw pointer interface).
* XOR is symmetric so encrypt and decrypt are the same operation. */
WOLFTPM_TEST_API int TPM2_ParamEnc_XOR(