Overcoming an Untrusted Computing Base: Detecting and Removing Malicious Hardware Automatically