An Evolutionary Approach to Hardware Encryption and Trojan-Horse Mitigation