TPMS_ALGORITHM_DETAIL_ECC_Marshal(TPMS_ALGORITHM_DETAIL_ECC *source, BYTE **buffer, INT32 *size)
{
    UINT16 written = 0;
    
    written += TPM_ECC_CURVE_Marshal(&source->curveID, buffer, size);
    written += UINT16_Marshal(&source->keySize, buffer, size);
    written += TPMT_KDF_SCHEME_Marshal(&source->kdf, buffer, size);
    written += TPMT_ECC_SCHEME_Marshal(&source->sign, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->p, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->a, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->b, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->gX, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->gY, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->n, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->h, buffer, size);
    return written;
}
TPMS_ALGORITHM_DETAIL_ECC_Marshal(TPMS_ALGORITHM_DETAIL_ECC *source, BYTE **buffer, INT32 *size)
{
    UINT16 written = 0;
    
    written += TPM_ECC_CURVE_Marshal(&source->curveID, buffer, size);
    written += UINT16_Marshal(&source->keySize, buffer, size);
    written += TPMT_KDF_SCHEME_Marshal(&source->kdf, buffer, size);
    written += TPMT_ECC_SCHEME_Marshal(&source->sign, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->p, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->a, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->b, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->gX, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->gY, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->n, buffer, size);
    written += TPM2B_ECC_PARAMETER_Marshal(&source->h, buffer, size);
    return written;
}