TPMU_SENSITIVE_COMPOSITE_Marshal(TPMU_SENSITIVE_COMPOSITE *source, BYTE **buffer, INT32 *size, UINT32 selector)
{
    UINT16 written = 0;

    switch (selector) {
#if ALG_RSA
      case TPM_ALG_RSA:
	written += TPM2B_PRIVATE_KEY_RSA_Marshal(&source->rsa, buffer, size);
	break;
#endif
#if ALG_ECC
      case TPM_ALG_ECC:
	written += TPM2B_ECC_PARAMETER_Marshal(&source->ecc, buffer, size);
	break;
#endif
#if ALG_KEYEDHASH
      case TPM_ALG_KEYEDHASH:
	written += TPM2B_SENSITIVE_DATA_Marshal(&source->bits, buffer, size);
	break;
#endif
#if ALG_SYMCIPHER
      case TPM_ALG_SYMCIPHER:
	written += TPM2B_SYM_KEY_Marshal(&source->sym, buffer, size);
	break;
#endif
      default:
	pAssert(FALSE);
    }
    return written;
}
TPMU_SENSITIVE_COMPOSITE_Marshal(TPMU_SENSITIVE_COMPOSITE *source, BYTE **buffer, INT32 *size, UINT32 selector)
{
    UINT16 written = 0;

    switch (selector) {
#if ALG_RSA
      case TPM_ALG_RSA:
	written += TPM2B_PRIVATE_KEY_RSA_Marshal(&source->rsa, buffer, size);
	break;
#endif
#if ALG_ECC
      case TPM_ALG_ECC:
	written += TPM2B_ECC_PARAMETER_Marshal(&source->ecc, buffer, size);
	break;
#endif
#if ALG_KEYEDHASH
      case TPM_ALG_KEYEDHASH:
	written += TPM2B_SENSITIVE_DATA_Marshal(&source->bits, buffer, size);
	break;
#endif
#if ALG_SYMCIPHER
      case TPM_ALG_SYMCIPHER:
	written += TPM2B_SYM_KEY_Marshal(&source->sym, buffer, size);
	break;
#endif
      default:
	pAssert(FALSE);
    }
    return written;
}