Malicious hardware detection and design for trust : an analysis