An analysis framework for hardware and software implementations with applications from cryptography. (July 2018)