I did a 5 minutes search. There seems to be a lot of work in detecting hardware trojans. Sec 3.12 here [1] discusses some of these approaches. One line is one of the things I was thinking of when I commented. Basically, there are tradeoffs of how logically hidden the trojan is against how physically exposed it is.
> Using this defense method, any Trojan that can analyze the entire configurable structure must use complicated logic functions and take up a large silicon area, which greatly increases the possibility of being detected by security tools.
There are live methods of detecting trojans as well, where you have an additional chip checking what the CPU is doing at all times [2].
One of the main thing I have learned in my life is to not underestimate the ingenuity of cryptographers.
[1] https://arxiv.org/pdf/2107.04175
[2] https://re.public.polimi.it/bitstream/11311/1204477/1/DFTS_2...