41-90 Vol. 3D
SGX INSTRUCTION REFERENCES
(* Determine values key is based on *)
TMP_KEYDEPENDENCIES.KEYNAME PROVISION_SEAL_KEY;
TMP_KEYDEPENDENCIES.ISVPRODID TMP_CURRENTSECS.ISVPRODID;
TMP_KEYDEPENDENCIES.ISVSVN DS:RBX.ISVSVN;
TMP_KEYDEPENDENCIES.OWNEREPOCH 0;
TMP_KEYDEPENDENCIES.ATTRIBUTES TMP_ATTRIBUTES;
TMP_KEYDEPENDENCIES.ATTRIBUTESMASK DS:RBX.ATTRIBUTEMASK;
TMP_KEYDEPENDENCIES.MRENCLAVE 0;
TMP_KEYDEPENDENCIES.MRSIGNER TMP_CURRENTSECS.MRSIGNER;
TMP_KEYDEPENDENCIES.KEYID 0;
TMP_KEYDEPENDENCIES.SEAL_KEY_FUSES CR_SEAL_FUSES;
TMP_KEYDEPENDENCIES.CPUSVN DS:RBX.CPUSVN;
TMP_KEYDEPENDENCIES.PADDING TMP_CURRENTSECS.PADDING;
TMP_KEYDEPENDENCIES.MISCSELECT TMP_MISCSELECT;
TMP_KEYDEPENDENCIES.MISCMASK ~DS:RBX.MISCMASK;
BREAK;
DEFAULT:
(* The value of KEYNAME is invalid *)
RFLAGS.ZF 1;
RAX SGX_INVALID_KEYNAME;
GOTO EXIT:
ESAC;
(* Calculate the final derived key and output to the address in RCX *)
TMP_OUTPUTKEY derivekey(TMP_KEYDEPENDENCIES);
DS:RCX[15:0] TMP_OUTPUTKEY;
RAX 0;
RFLAGS.ZF 0;
EXIT:
RFLAGS.CF 0;
RFLAGS.PF 0;
RFLAGS.AF 0;
RFLAGS.OF 0;
RFLAGS.SF 0;
Flags Affected
ZF is cleared if successful, otherwise ZF is set. CF, PF, AF, OF, SF are cleared.
Protected Mode Exceptions
#GP(0)
If a memory operand effective address is outside the current enclave.
If an effective address is not properly aligned.
If an effective address is outside the DS segment limit.
If KEYREQUEST format is invalid.
#PF(error code)
If a page fault occurs in accessing memory.
64-Bit Mode Exceptions
#GP(0)
If a memory operand effective address is outside the current enclave.
If an effective address is not properly aligned.
If an effective address is not canonical.
If KEYREQUEST format is invalid.
#PF(error code)
If a page fault occurs in accessing memory operands.