PEIGEN – a Platform for Evaluation, Implementation, and Generation of S‑Boxes
Total Page:16
File Type:pdf, Size:1020Kb
This document is downloaded from DR‑NTU (https://dr.ntu.edu.sg) Nanyang Technological University, Singapore. PEIGEN – a platform for evaluation, implementation, and generation of S‑boxes Sasaki, Yu; Ling, San; Guo, Jian; Bao, Zhenzhen 2019 Bao, Z., Guo, J., Ling, S., & Sasaki, Y. (2019). PEIGEN – a platform for evaluation, implementation, and generation of S‑boxes. IACR Transactions on Symmetric Cryptology, 2019(1), 330‑394. doi:10.13154/tosc.v2019.i1.330‑394 https://hdl.handle.net/10356/90012 © 2019 The Author(s) (Published by Ruhr University Bochum). Licensed under Creative Commons License CC‑BY 4.0 Downloaded on 27 Sep 2021 17:45:19 SGT Peigen – a Platform for Evaluation, Implementation, and Generation of S-boxes Zhenzhen Bao1,2, Jian Guo1, San Ling1 and Yu Sasaki3 1 Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, Singapore. {zzbao,guojian,lingsan}@ntu.edu.sg 2 Strategic Centre for Research in Privacy-Preserving Technologies and Systems, Nanyang Technological University, Singapore 3 NTT Secure Platform Laboratories, 3-9-11, Midori-cho Musashino-shi, Tokyo 180-8585, Japan. [email protected] Abstract. In this paper, a platform named Peigen is presented to evaluate security, find efficient software/hardware implementations, and generate cryptographic S-boxes. Continuously developed for decades, S-boxes are constantly evolving in terms of the design criteria for both security requirements and software/hardware performances. Peigen is aimed to be a platform covering a comprehensive check-list of design criteria of S-boxes appearing in the literature. To do so, the security requirements are first intensively surveyed, existing tools of S-boxes are then comprehensively compared, and finally our platform Peigen is presented. The survey part is aimed to be a systematic reference for the theoretical study of S-boxes. The platform is aimed to be an assistant tool for the experimental study and practical use of S-boxes. Peigen not only integrates most of the features in existing tools, but also equips with functionalities to evaluate new security-related properties, improves the efficiency of the search algorithms for optimized implementations in several aspects. With the help of this powerful platform, many interesting observations are made in-between the security notations, as well as on the S-boxes used in the existing symmetric- key cryptographic primitives. Peigen will become an open platform and welcomes contributions from all parties to help the community to facilitate the research and use of S-boxes. Keywords: S-box · Survey · Design criteria · Implementation criteria · New platform 1 Introduction The substitution-box, or S-box for short, is commonly used in the design of symmetric cryptography primitives to offer non-linearity. In general, an S-box is a nonlinear mapping n m defined on F2 → F2 , which takes as input a value of n bits and outputs a value of m bits. For instance, the data encryption standard (DES) S-boxes are mappings with (n = 6, m = 4) and the advanced encryption standard (AES) S-box is a permutation with (n = m = 8). S-boxes have two key aspects: the security strength and the performance in software/hardware. In many cases, the two merits conflict, and hence trade-offs are made to fit the overall design’s priorities. The security requirements for S-boxes, depending on the design strategy of the overall primitive, evolve over time. Each security requirement corresponds to a goal of resisting some cryptographic attacks, e.g., the high algebraic degree of an S-box can be used as arguments against algebraic attacks such as integral attacks. As new attacks are devised, new properties are added into the pool of S-box security requirements, e.g., invariant Licensed under Creative Commons License CC-BY 4.0. IACR Transactions on Symmetric Cryptology ISSN 2519-173X, Vol. 2019, No. 1, pp. 330–394 DOI:10.13154/tosc.v2019.i1.330-394 Zhenzhen Bao, Jian Guo, San Ling and Yu Sasaki 331 subspace attacks [LAAZ11, GJN+16] against PRINTcipher [KLPR10] and Midori [BBI+15] triggered research/constraints on the combination of S-boxes and round constants, which did not exist before 2011. Meanwhile, not all security requirements have to be fulfilled by every design, since some attacks can be resisted by other design components, e.g., round constants can be used to break symmetry and to resist slide attacks. Thus, there is a trade-off between the subset of the required security properties for S-boxes and the complexity of other components of the overall primitive. The implementation aspects of S-boxes cover both software and hardware. There are several ways to implement S-boxes in software depending on the platform and resources available. One common method is the table-lookup, which pre-computes a Look-Up Table (LUT) by exhausting all possible input values and storing the outputs in a table. The S-box is subsequently performed by accessing the table, usually indexed by the input values. The LUT method is subject to cache-timing attacks [Ber05]. To resist them, there are (close to) constant-time implementation methods such as algebraic implementations and bitsliced implementations. Both express the S-box by its algebraic form, and hence the execution time is independent of the input value. The difference is that bitsliced implementations usually take multiple parallel inputs and process all simultaneously by utilizing long registers such as streaming SIMD extensions (SSE) registers, by which the relative performance per input can be significantly improved. Depending on the target use, the most commonly known Integrated Circuits (ICs) are Application Specific IC (ASIC) and Field Programmable Gate Array (FPGA). The implementation and performance of S-boxes on either IC can be very different. On both types of IC, there are also different ways of optimization, which will result in very different performance. For example, on ASIC and FPGA, there is the so-called serialized implementation aiming for smallest area occupied, and the depth optimized implementation usually taking a relatively larger area but resulting in higher frequency and throughput. To make a better trade-off between the security and performance, there is a line of research developing tools for finding the optimal implementations. Given an S-box, Osvik [Osv00] tried to find the software implementation optimized in terms of CPU cycles. Given an S-box, Guo et al. [GJN+16] proposed a method to find an implementation in ASIC optimized in terms of circuit depth. Given an S-box and the cost of each unit operation, Jean et al. [JPST17] built a tool named LIGHTER to find implementations with small area in ASIC or with small number of instructions in Software. More related works are listed in Table5. Our contributions. Constant efforts are made by our community to research S-boxes, in the hope of providing the best design choices to yield ciphers that are not only strong enough to resist attacks but also efficient to be of practical use. Such efforts include those made to remedy the situation after occasional bursts of striking attacks, and those made to seek the best possible instances to enrich the portfolio of design candidates. In this paper, we combine results achieved by these efforts. We first follow the line of research in developing design criteria for S-boxes. Rich results have been obtained by our community in this line. Some earlier results turned out to be fundamental theories, while some newly proposed notions need to be further developed. We try to provide a comprehensive exhibit. The main line of our exhibition follows the line of attacks. Many known results proposed or implied criteria for avoiding each type of attack. Some criteria can generally apply to any S-box based designs whereas others assume a particular type of round function structure. Both types are taken into account in this paper to form a comprehensive check list for designers. Besides the security, we consider the S-box criteria to be efficiently implemented. One aspect we also considered are equivalent classes for the S-box and the link between different classes. These will help the designers to identify the search space of the S-box that satisfies certain criteria. A huge amount of previous research on S-boxes makes our 332 Peigen – a Platform for Evaluation, Implementation, and Generation of S-boxes exhibit quite long. However, integration of the many criteria appearing in the long history of S-box design will be useful for future S-box designers and researchers. In the later part of this paper, we follow the line of research in developing tools for evaluating and implementing S-box. We start by comprehensively surveying the state-of- the-art in tool development. We found that different tools are written in different languages with different interfaces. Some of them are not publicly accessible. Each tool focuses on its target criteria, thus we need to use/implement multiple tools to evaluate multiple criteria, which is already non-trivial. In particular, security and implementation aspects are hard to consider simultaneously. This motivates us to present a platform named Peigen for evaluating the security properties, finding optimal implementations for given S-boxes, and generating all suitable S-boxes when the security and performance requirements are given. Peigen is built upon existing tools. After making a comprehensive comparison, we decide to build Peigen using the implementation model of LIGHTER proposed by Jean et al. [JPST17]. More explicitly, Peigen was built on the basis of a sub-module of LIGHTER which is for finding software/hardware implementations that are good in terms of Bitslice Gate Complexity (BGC), Gate Equivalent Complexity (GEC), and Multiplicative Complexity (MC), for 4-bit bijective S-boxes. Peigen inherits all functionalities provided by LIGHTER, and at the same time, improves the search efficiency using algorithmic-level optimizations, e.g., the composition and concatenation method and the pre-computation mechanism.