Bricklayer Attack: A Side-Channel Analysis on the ChaCha Quarter Round Alexandre Adomnicai1;3, Jacques J.A. Fournier2, and Laurent Masson1 1 Trusted Objects, Aix-en-Provence, France, fa.adomnicai,
[email protected] 2 CEA-Leti, Grenoble, France,
[email protected] 3 EMSE, Gardanne, France, Abstract. ChaCha is a family of stream ciphers that are very efficient on constrainted platforms. In this paper, we present electromagnetic side- channel analyses for two different software implementations of ChaCha20 on a 32-bit architecture: one compiled and another one directly written in assembly. On the device under test, practical experiments show that they have different levels of resistance to side-channel attacks. For the most leakage-resilient implementation, an analysis of the whole quarter round is required. To overcome this complication, we introduce an optimized attack based on a divide-and-conquer strategy named bricklayer attack. Keywords: ChaCha, Implementation, Side-channel attacks 1 Introduction ChaCha [7] is a family of stream ciphers introduced by Daniel J. Bernstein in 2008. It is a variant of the Salsa20 family [8], which is part of the eSTREAM portfolio [4], providing better diffusion for similar performances. ChaCha is an ARX-based cipher, which means that it only uses modular additions, rotations and bitwise XORs. It has been widely adopted for encryption, as well as for ran- dom number generation in many operating systems (e.g. Linux, OpenBSD) and protocols (e.g. SSH, TLS). Moreover, the upcoming version 1.3 of the Transport Layer Security (TLS) protocol [36] will allow Authenticated Encryption with As- sociated Data (AEAD) cipher suites only, leaving AES-CCM [32], AES-GCM [38] and ChaCha20-Poly1305 [26] as the only three options.