Paper 2023/1134

Randomness Generation for Secure Hardware Masking - Unrolled Trivium to the Rescue

Gaëtan Cassiers, Graz University of Technology
Loïc Masure, UCLouvain
Charles Momin, UCLouvain
Thorben Moos, UCLouvain
Amir Moradi, Ruhr University Bochum
François-Xavier Standaert, UCLouvain

Masking is a prominent strategy to protect cryptographic implementations against side-channel analysis. Its popularity arises from the exponential security gains that can be achieved for (approximately) quadratic resource utilization. Many variants of the countermeasure tailored for different optimization goals have been proposed over the past decades. The common denominator among all of them is the implicit demand for robust and high entropy randomness. Simply assuming that uniformly distributed random bits are available, without taking the cost of their generation into account, leads to a poor understanding of the efficiency and performance of secure implementations. This is especially relevant in case of hardware masking schemes which are known to consume large amounts of random bits per cycle due to parallelism. Currently, there seems to be no consensus on how to most efficiently derive many pseudo-random bits per clock cycle from an initial seed and with properties suitable for masked hardware implementations. In this work, we evaluate a number of building blocks for this purpose and find that hardware-oriented stream ciphers like Trivium and its reduced-security variant Bivium B outperform all competitors when implemented in an unrolled fashion. Unrolled implementations of these primitives enable the flexible generation of many bits per cycle while maintaining high performance, which is crucial for satisfying the large randomness demands of state-of-the-art masking schemes. According to our analysis, only Linear Feedback Shift Registers (LFSRs), when also unrolled, are capable of producing long non-repetitive sequences of random-looking bits at a high rate per cycle even more efficiently than Trivium and Bivium B. Yet, these instances do not provide black-box security as they generate only linear outputs. We experimentally demonstrate that using multiple output bits from an LFSR in the same masked implementation can violate probing security and even lead to harmful randomness cancellations. Circumventing these problems, and enabling an independent analysis of randomness generation and masking scheme, requires the use of cryptographically stronger primitives like stream ciphers. As a result of our studies, we provide an evidence-based estimate for the cost of securely generating n fresh random bits per cycle. Depending on the desired level of black-box security and operating frequency, this cost can be as low as 20n to 30n ASIC gate equivalents (GE) or 3n to 4n FPGA look-up tables (LUTs), where n is the number of random bits required. Our results demonstrate that the cost per bit is (sometimes significantly) lower than estimated in previous works, incentivizing parallelism whenever exploitable and potentially moving low randomness usage in hardware masking research from a primary to secondary design goal.

Available format(s)
Publication info
Hardware MaskingRandomnessSide-Channel AnalysisTrivium
Contact author(s)
gaetan cassiers @ iaik tugraz at
loic masure @ uclouvain be
charles momin @ uclouvain be
thorben moos @ uclouvain be
amir moradi @ rub de
fstandae @ uclouvain be
2023-07-24: approved
2023-07-20: received
See all versions
Short URL
Creative Commons Attribution


      author = {Gaëtan Cassiers and Loïc Masure and Charles Momin and Thorben Moos and Amir Moradi and François-Xavier Standaert},
      title = {Randomness Generation for Secure Hardware Masking - Unrolled Trivium to the Rescue},
      howpublished = {Cryptology ePrint Archive, Paper 2023/1134},
      year = {2023},
      note = {\url{}},
      url = {}
Note: In order to protect the privacy of readers, does not use cookies or embedded third party content.