High-Level Approaches to Hardware Security: A Tutorial