TPMU_ATTEST_Unmarshal(TPMU_ATTEST *target, BYTE **buffer, INT32 *size, UINT32 selector)
{
    TPM_RC rc = TPM_RC_SUCCESS;

    switch (selector) {
      case TPM_ST_ATTEST_CERTIFY:
	rc = TPMS_CERTIFY_INFO_Unmarshal(&target->certify, buffer, size);
	break;
      case TPM_ST_ATTEST_CREATION:
	rc = TPMS_CREATION_INFO_Unmarshal(&target->creation, buffer, size);
	break;
      case TPM_ST_ATTEST_QUOTE:
	rc = TPMS_QUOTE_INFO_Unmarshal(&target->quote, buffer, size);
	break;
      case TPM_ST_ATTEST_COMMAND_AUDIT:
	rc = TPMS_COMMAND_AUDIT_INFO_Unmarshal(&target->commandAudit, buffer, size);
	break;
      case TPM_ST_ATTEST_SESSION_AUDIT:
	rc = TPMS_SESSION_AUDIT_INFO_Unmarshal(&target->sessionAudit, buffer, size);
	break;
      case TPM_ST_ATTEST_TIME:
	rc = TPMS_TIME_ATTEST_INFO_Unmarshal(&target->time, buffer, size);
	break;
      case TPM_ST_ATTEST_NV:
	rc = TPMS_NV_CERTIFY_INFO_Unmarshal(&target->nv, buffer, size);
	break;
      default:
	rc = TPM_RC_SELECTOR;
	
    }
    return rc;
}
TPMU_ATTEST_Unmarshal(TPMU_ATTEST *target, BYTE **buffer, INT32 *size, UINT32 selector)
{
    TPM_RC rc = TPM_RC_SUCCESS;

    switch (selector) {
      case TPM_ST_ATTEST_CERTIFY:
	rc = TPMS_CERTIFY_INFO_Unmarshal(&target->certify, buffer, size);
	break;
      case TPM_ST_ATTEST_CREATION:
	rc = TPMS_CREATION_INFO_Unmarshal(&target->creation, buffer, size);
	break;
      case TPM_ST_ATTEST_QUOTE:
	rc = TPMS_QUOTE_INFO_Unmarshal(&target->quote, buffer, size);
	break;
      case TPM_ST_ATTEST_COMMAND_AUDIT:
	rc = TPMS_COMMAND_AUDIT_INFO_Unmarshal(&target->commandAudit, buffer, size);
	break;
      case TPM_ST_ATTEST_SESSION_AUDIT:
	rc = TPMS_SESSION_AUDIT_INFO_Unmarshal(&target->sessionAudit, buffer, size);
	break;
      case TPM_ST_ATTEST_TIME:
	rc = TPMS_TIME_ATTEST_INFO_Unmarshal(&target->time, buffer, size);
	break;
      case TPM_ST_ATTEST_NV:
	rc = TPMS_NV_CERTIFY_INFO_Unmarshal(&target->nv, buffer, size);
	break;
      default:
	rc = TPM_RC_SELECTOR;
	
    }
    return rc;
}