<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Design and Evaluation of AES Encryption Circuits with Various S-Box Implementations</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Taosong Zhao</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hiroki Nishikawa</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Engineering, Toyama Prefectural University</institution>
          ,
          <addr-line>Imizu</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Graduate School of Information Science and Technology, Osaka University</institution>
          ,
          <addr-line>Suita</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Graduate School of Science and Engineering, Ritsumeikan University</institution>
          ,
          <addr-line>Kusatsu</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <fpage>48</fpage>
      <lpage>53</lpage>
      <abstract>
        <p>AES is an encryption standard approved by the National Institute of Standards and Technology (NIST) to replace the DES cipher. Since its approval in 2001, AES has been widely used, and various studies on its performance and security have been conducted so far. The S-Box, a fixed table used in the SubBytes process and the only non-linear transformation in the AES encryption algorithm, plays a crucial role. In this work, we design a number of AES circuits with different S- Box generation methods, and investigate their impacts on hardware cost, performance and power consumption.</p>
      </abstract>
      <kwd-group>
        <kwd>1 AES</kwd>
        <kwd>S-Box</kwd>
        <kwd>high-level synthesis</kwd>
        <kwd>FPGA</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        To ensure secure message interactions, it is necessary to encrypt messages when they are sent. AES
(Advanced Encryption Standard) is a symmetric encryption algorithm that was certified by the National
Institute of Standards and Technology in 2001 to replace the less secure DES encryption algorithm.
AES was developed by Joan Daemen and Vincent Rijmen and designed to be efficient in both hardware
and software [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref2">2</xref>
        ][
        <xref ref-type="bibr" rid="ref3">3</xref>
        ][
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. AES supports a block length of 128 bits and key lengths of 128, 192, and 256
bits. The AES encryption flow is outlined in Figure 1. It consists of four main parts: Key Expansion,
Initial Round Key Addition, 9, 11, or 13 rounds of encryption, and Final Round Encryption. For a
128bit key length, the total encryption rounds would be 10. AES operates on a 4×4 column-major order
array of 16 bytes. The key size used for an AES cipher specifies the number of transformation rounds
that convert the input, called plaintext, into the final output, called ciphertext.
      </p>
      <p>For each encryption round, AES includes four parts in order: SubBytes, ShiftRows, MixColumns,
and AddRoundKeys. With a key length of 128 bits, the encryption process is the same for the first 9
rounds, and the MixColumns step is omitted for the last round of encryption. In the SubBytes step, each
byte in the state array is replaced with a SubBytes value using an 8-bit substitution box (S-Box). The
SubBytes step is the only non-linear process within AES encryption. The ShiftRows step cyclically
shifts the bytes in each row of the state by a certain offset. In the MixColumns step, the four bytes of
each column of the state are combined using a reversible linear transformation. The MixColumns
function takes four bytes as input and outputs four bytes, where each input byte affects all four output
bytes. In the AddRoundKeys step, the sub-key is combined with the state. For each round, a sub-key is
derived from the main key using Rijndael's key schedule. Each sub-key is the same size as the state.
The sub-key is added by combining each byte of the state with the corresponding byte of the sub-key
using bitwise XOR.</p>
      <p>In this work, we design a number of AES circuits with different S-Box generation methods for FPGA
and investigate their impact on hardware cost, performance and power consumption of the circuits. The
contribution of this work is quantitative evaluation of existing S-Box generation methods in terms of
hardware resources, power consumption and critical path delay. In addition, we propose a modified
method to further reduce hardware resources.</p>
      <p>The remainder of the paper is organized as follows. Section 2 outlines our flow for designing AES
encryption circuits and describes the different methods used to produce the S-Box. Section 3 evaluates
the designed AES circuits, and Section 4 concludes the paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2. AES Encryption Circuit Design</title>
      <p>This section describes how to design AES encryption circuits with different S-Box methods. The
AES circuits are designed based on two design flows: high-level synthesis and register-transfer level
(RTL) design. We use Xilinx’s Zynq-7000 SoC device as the target hardware, Vitis HLS for high-level
synthesis to generate RTL code, and Vivado for logic synthesis and simulation to evaluate hardware
resources, performance and power consumption.
2.1.</p>
    </sec>
    <sec id="sec-3">
      <title>Overall Design Flow</title>
      <p>As a first step, we use the Vitis HLS tool to generate an AES encryption circuit from a C/ C++
program, with the S-Box implemented as a simple look-up table (LUT). This initial design serves as a
baseline for subsequent designs. We then design eight S- Box circuits, either using Vitis HLS or
manually coding in Verilog, and replace the initial LUT- based S-Box with the new ones, while the
remaining modules are unchanged.
2.2.</p>
    </sec>
    <sec id="sec-4">
      <title>S-Box Generation Methods</title>
      <p>The S-Box, shown in Figure 2, is one of the most important components of AES encryption, which
maps an 8-bit input to an 8-bit output, and is interpreted as polynomials over GF(2). The S-Box is used
for byte substitution operations, which are the only nonlinear operations in AES encryption and have a
significant impact on the overall performance and security of the algorithm. Thus, the method used to
generate the S-box affects the comprehensive performance and security of AES encryption.</p>
      <p>We have tested two flows to generate S-Box circuits. One uses high-level synthesis, and the other is
manual RTL coding in Verilog.</p>
    </sec>
    <sec id="sec-5">
      <title>2.2.1. Look-up Table</title>
      <p>
        First, we employ a byte substitution method using direct query of the S-Box table [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ][
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In this
method, the 256 fixed values are stored in advance in a 16×16 look-up table, and the pre-stored values
are directly called when byte substitution is performed. Using the table look- up method for byte
substitution, the pre-stored values are directly used without the need to calculate the values in the
SBox.
      </p>
    </sec>
    <sec id="sec-6">
      <title>2.2.2. Composite Field Arithmetic</title>
      <p>
        Next, we design S-Box circuits based on composite field arithmetic (CFA). Specifically, we employ
Galois fields GF(22) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ][
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and GF(24) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ][
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Since the computation of S-Box in GF(28) is hardware
intensive, CFA of order GF((24)2) is used to reduce hardware requirement [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Since the computation of multiplicative inverse in composite fields cannot be directly applied to an
element α, which is based on GF(28), it has to be mapped to its composite field representation via an
isomorphic function given by:</p>
      <p>Similarly, after performing the multiplicative inversion, the result has to be mapped back from its
composite field representation to its equivalent in GF(28) using the inverse isomorphic function δ−1 .
The matrix δ−1 required to map an element β is shown as follows:</p>
    </sec>
    <sec id="sec-7">
      <title>2.2.3. Positive Polarity Reed-Muller</title>
      <p>
        The main disadvantage of S-Box realization using CFA is the complex signal paths, which can result
in long signal delays. To address this issue, Positive Polarity Reed-Muller (PPRM) methods have been
proposed [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ][12]. With PPRM, the S-Box is converted into two-level logic using only arrays of XOR
and AND gates. The main advantage of this approach is that it reduces dynamic hazards that can occur
in combination circuits.
      </p>
      <p>The PPRM-based SubBytes transformation architecture is shown in Figure 2. These three stages of
operation take place at the three different stages of the SubBytes transformation, which are called
preinversion, inversion, and post-inversion stages. All three stages can be realized using an array of AND
and XOR gates. In the second stage, only one of the first stage’s outputs needs to be computed, and the
result will be input into the third stage.</p>
      <p>We extract common computations which appear three times or more, and reuse the computation
results for the second appearance and later as shown in Listing 2. In Listing 2,we take PPRM stage 1
as an example. We made the same optimizations for the remaining PPRM stage 2 and stage 3.</p>
      <p>Listing 2: Modified Verilog code for PPRM stage 1
temp1 = (x5&amp;x6)^(x7&amp;x0)^(x3&amp;x2);
temp2 = (x5&amp;x7)^(x5&amp;x2)^(x2&amp;x4);
c3 = (x7&amp;x1)^(x5&amp;x1)^(x5&amp;x4)^(x7&amp;x4)^ (x5&amp;x0)^(x3&amp;x1)^(x4&amp;x1)^(x4&amp;x6)^(x2&amp;x1)
^(x2&amp;x6)^(x6&amp;x1)^temp1^temp2;
c2 = (x6&amp;x1)^(x2&amp;x6)^(x3&amp;x6)^(x7&amp;x6)^ (x1&amp;x0)^(x2&amp;x0)^(x3&amp;x0)^(x4&amp;x0)^ (x6&amp;x0)
^(x5&amp;x3)^(x3&amp;x4)^(x7&amp;x2)^ (x7&amp;x3)^temp1^temp2;
c1 = (x2&amp;x1)^ (x5&amp;x4)^(x3&amp;x6)^(x2&amp;x0)^(x3&amp;x0)^(x5&amp;x0)^(x7&amp;x2)^(x5&amp;x3)^ (x7^x2)
^(x4^x5)^x1^temp1^temp2;
c0 = (x1&amp;x0)^(x2&amp;x0)^(x3&amp;x0)^(x5&amp;x0)^(x3&amp;x1)^(x6&amp;x1)^(x3&amp;x6)^(x7&amp;x6)^(x3&amp;x4)
^(x7&amp;x4)^(x5&amp;x3)^(x4&amp;x1)^(x4&amp;x6)^x2^x6^x5^x3^x0^temp1;</p>
    </sec>
    <sec id="sec-8">
      <title>3. Evaluation</title>
      <p>We have designed nine AES encryption circuits, synthesized them for FPGA, and run simulation
using the Vivado toolkit. A clock period constraint was set to be 10 ns. The number of clock cycles
executed was the same among the nine circuits, as only the S-Box implementation differs between them.</p>
      <p>The synthesis results are summarized in Table 2. Among the four existing methods to implement the
S-Box, PPRM-based implementation is the smallest in size. Our modified PPRM-based circuit
outperforms the original PPRM- based one in terms of size. It is also observed that HLS- generated
circuits are larger in size and consumes more power than manually-designed ones. On the reasons for
this outcome, we hypothesize that it is possible that the circuits automatically generated by the high
level synthesis method contain some redundant designs, resulting in consuming more hardware
resource consumption. In VHDL design, we can have a good grasp of the use of hardware resources,
which is more favorable for the design of the area constraints.</p>
      <p>Look- up Table</p>
      <p>CFA GF(22)
CFA GF(24)</p>
      <p>PPRM</p>
      <p>Modified PPRM</p>
    </sec>
    <sec id="sec-9">
      <title>4. Summary</title>
      <p>HLS
RTL
HLS
RTL
HLS
RTL
HLS
RTL
RTL</p>
      <p>In this work, we have designed and evaluated nine AES circuits, where design flows and S-Box
generation methods are different. The synthesis results show that the PPRM-based circuit modified in
this work is the best among the nine in terms of hardware cost. However, at this stage we have not
characterized the possible negative effects of these methods tested on the whole circuit.</p>
      <p>In future, we plan to further optimize the circuit and adjust the clock cycles. Also, we plan to
evaluate hardware security in addition to hardware cost, performance and power consumption.</p>
    </sec>
    <sec id="sec-10">
      <title>Acknowledgements</title>
      <p>52</p>
      <p>This work is supported partly by KAKENHI 20H00590,21K19776 and 22K21276.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Yulin</given-names>
            <surname>Zhang</surname>
          </string-name>
          , Xinggang Wang, “
          <source>Pipelined Implementation of AES Encryption Based on FPGA,” International Conference on Information Theory and Information Security</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Xinmiao</given-names>
            <surname>Zhang</surname>
          </string-name>
          , Keshab K. Parhi, “
          <article-title>High-Speed VLSI Architectures for the AES Algorithm,” IEEE Transactions on Very Large Scale Integration (VLSI) Systems</article-title>
          , vol.
          <volume>12</volume>
          , no.
          <issue>9</issue>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Mohammad</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Musa</surname>
          </string-name>
          , Edward F. Schaefer, Stephen Wedig, “
          <article-title>A Simplified AES Algorithm and Its Linear and Differential Cryptanalyses,” Cryptologia</article-title>
          , vol.
          <volume>27</volume>
          , no.
          <issue>2</issue>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [ 4]
          <string-name>
            <given-names>Chen</given-names>
            <surname>Yicheng</surname>
          </string-name>
          , Zou Xuecheng, Liu Zhenglin, Han Yu, Zheng Zhaoxia, “
          <article-title>Energy-efficient and Security-optimized AES Hardware Design for Ubiquitous Computing</article-title>
          ,
          <source>” Journal of Systems Engineering and Electronics</source>
          , vol.
          <volume>19</volume>
          , no.
          <issue>4</issue>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [ 5]
          <string-name>
            <given-names>Yuko</given-names>
            <surname>Hara</surname>
          </string-name>
          , Hiroyuki Tomiyama, Shinya Honda, Hiroaki Takada, “
          <article-title>Proposal and Quantitative Analysis of the CHStone Benchmark Program Suite for Practical C-based High-level Synthesis,”</article-title>
          <source>Journal of Information Processing</source>
          , vol.
          <volume>17</volume>
          , pp.
          <fpage>242</fpage>
          -
          <lpage>254</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [ 6]
          <string-name>
            <given-names>Pawel</given-names>
            <surname>Chodowiec</surname>
          </string-name>
          , Kris Gaj, “
          <article-title>Very Compact FPGA Implementation of the AES Algorithm, ”</article-title>
          <source>International Workshop on Cryptographic Hardware and Embedded Systems</source>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Aditya</given-names>
            <surname>Pradeep</surname>
          </string-name>
          , Vishal Mohanty, Adarsh Muthuveeru Subramaniam, Chester Rebeiro, “
          <article-title>Revisiting AES SBox Composite Field Implementations for FPGAs,” IEEE Embeded Systems Letters</article-title>
          , vol.
          <volume>11</volume>
          , no.
          <issue>3</issue>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Rashmi</given-names>
            <surname>Ramesh Rachh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. S.</given-names>
            <surname>Anami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. V.</given-names>
            <surname>Ananda</surname>
          </string-name>
          <string-name>
            <surname>Mohan</surname>
          </string-name>
          , “
          <article-title>Efficient Implementations of S-Box and Inverse S-Box for AES Algorithm,”</article-title>
          <source>IEEE Region 10 Conference</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Ahmet</given-names>
            <surname>Dogan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. Berna</given-names>
            <surname>Ors</surname>
          </string-name>
          , Gokay Saldamli, “
          <article-title>Analyzing and Comparing the AES Architectures for their Power Consumption,”</article-title>
          <source>Journal of Intelligent Manufacturing</source>
          , vol.
          <volume>25</volume>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [ 10]
          <string-name>
            <given-names>Thanikodi</given-names>
            <surname>Manoj</surname>
          </string-name>
          <string-name>
            <surname>Kumar</surname>
          </string-name>
          , Kasarla Satish Reddy, Stefano Rinaldi, Bidare Divakarachari Parameshachari, Kavitha Arunachalam,
          <article-title>“A Low Area High Speed FPGA Implementation of AES Architecture for Cryptography Application</article-title>
          ,” Electronics, vol.
          <volume>10</volume>
          , no.
          <issue>16</issue>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>T.</given-names>
            <surname>Manojkumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Karthigaikumar</surname>
          </string-name>
          , Varatharajan Ramachandran, “
          <article-title>An Optimized S-Box Circuit for High Speed AES Design with Enhanced PPRM Architecture to Secure Mammography Images</article-title>
          ,
          <source>” Journal of Medical Systems</source>
          , vol.
          <volume>43</volume>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>