Extending tamper-proof hardware security to untrusted execution environments