Simultaneously ensuring smartness, security, and energy efficiency in Internet-of-Things sensors