SGX treats the system software as untrusted and potentially malicious. For this reason the measurement of enclaves is used. It allows the application creating the enclave to ensure the setup was done correct. This includes the commands used as well as the data and code setup in the enclave. This prevents the system software or privileged attackers from manipulating the enclaves code and data during the setup, for example by loading other pages then requested by the application or manipulating the pages before they are loaded into the enclave.