SMART: Secure and Minimal Architecture for (Establishing a Dynamic) Root of Trust