SMS versenden: Mathematical Foundations for Side-Channel Analysis of Cryptographic Systems