← DS:RDX[63:0];</p>
<p>(* Decrypt and MAC page. AES_GCM_DEC has 2 outputs, {plain text, MAC} *)</p>
<p>(* Parameters for AES_GCM_DEC {Key, Counter, ..} *)</p>
<p>{DS:RCX, TMP_MAC}←AES_GCM_DEC(CR_BASE_PK, TMP_VER &lt;&lt; 32, TMP_HEADER, 128, DS:RCX, 4096);</p>
<p>IF ( (TMP_MAC ≠ DS:TMP_PCMD.MAC) )</p>
<p>THEN</p>
<p>RFLAGS.ZF ← 1;</p>
<p>RAX← SGX_MAC_COMPARE_FAIL;</p>
<p>GOTO ERROR_EXIT;</p>
<p>FI;</p>
<p>(* Check version before committing *)</p>
<p>IF (DS:RDX ≠ 0)</p>
<p>THEN #GP(0);</p>
<p>ELS