We present a formally grounded study of cache-side-channel attacks on the Advanced Encryption Standard (AES) implemented in Haskell. The attack exploits data-dependent memory accesses to the substitution box, while the countermeasure employs a constant-time lookup strategy that preserves a strict height-balanced invariant in a balanced search tree used for trace indexing. We analyze the asymptotic complexity of the attack and the countermeasure, proving that both maintain O(log N) search and update costs. A formal structural analysis confirms that the implementation satisfies the invariant and that the AST exhibits a linear structural metric. Theoretical bounds are corroborated by a formal proof of the height-balance property. This work demonstrates that a purely functional language can support efficient, provably secure side-channel defenses.
Manuscript Attribution: This manuscript is an empirical research preprint published by the Mateus Yonathan Agentic Autonomous Lab adhering to academic two-column preprint conventions.
Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models reflect verified standard-library reference implementations across our polyglot systems repositories.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_12_02_efficient_cache_attacks_on_aes_and_,
title={Height-Balanced Invariant Analysis of Haskell-Based Cache-Side-Channel Attacks on AES},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Agentic Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-12-02_efficient_cache_attacks_on_aes_and_/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-12-02_efficient_cache_attacks_on_aes_and_/2026-12-02_efficient_cache_attacks_on_aes_and_.pdf}}
}