0% found this document useful (0 votes)
30 views2 pages

Bitslice AES Implementation Techniques

Uploaded by

test123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Bitslice AES Implementation Techniques

Uploaded by

test123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Bitslice Implementation of AES

Chester Rebeiro, David Selvakumar, and A.S.L. Devi

Real Time Systems Group


Centre For Development of Advanced Computing
Bangalore, India
{rebeiro, david}@[Link]

Abstract. Network applications need to be fast and at the same time


provide security. In order to minimize the overhead of the security algo-
rithm on the performance of the application, the speeds of encryption
and decryption of the algorithm are critical. To obtain maximum per-
formance from the algorithm, efficient techniques for its implementation
must be used and the implementation must be tuned for the specific
hardware on which it is running.
Bitslice is a non-conventional but efficient way to implement DES in
software. It involves breaking down of DES into logical bit operations so
that N parallel encryptions are possible on a single N -bit microproces-
sor. This results in tremendous throughput. AES is a symmetric block
cipher introduced by NIST as a replacement for DES. It is rapidly be-
coming popular due to its good security features, efficiency, performance
and simplicity. In this paper we present an implementation of AES us-
ing the bitslice technique. We analyze the impact of the architecture
of the microprocessor on the performance of bitslice AES. We consider
three processors; the Intel Pentium 4, the AMD Athlon 64 and the Intel
Core 2. We optimize the implementation to best utilize the superscalar
architecture and SIMD instruction set present in the processors.

1 Introduction
Security is the most important feature of a cryptographic algorithm. An im-
portant secondary requirement is an efficient implementation in hardware and
software. The most efficient implementations are generally done in dedicated
hardware engines such as in FPGAs and ASICs. However, there are several ap-
plications such as networking software, operating system modules, etc., which
require fast encryptions but do not have these hardware engines. These appli-
cations make an efficient software implementation of cryptographic algorithms
important.
The bitslice implementation of DES [1][5] is the most efficient software imple-
mentation of DES. It involves converting the algorithm into a series of logical bit
operations using XOR, AND, OR and NOT logical gates. When implemented
on a microprocessor with a N -bit register width, each bit in the register acts as
a 1-bit processor doing a different encryption, therefore N encryptions are done
in parallel. This results in significant improvements in throughput.

D. Pointcheval, Y. Mu, and K. Chen (Eds.): CANS 2006, LNCS 4301, pp. 203–212, 2006.

c Springer-Verlag Berlin Heidelberg 2006
204 C. Rebeiro, D. Selvakumar, and A.S.L. Devi

Another advantage of a bitslice implementation is that it is immune to cache-


timing attacks. Traditional methods of implementing block ciphers make use of
several tables to improve performance [4]. The memory access patterns of the
implementation make it vulnerable to cryptanalysis [12] [13]. A bitslice imple-
mentation on the other hand is based only on logical operations, there are no
tables involved, therefore it is free from attacks based on cache timing analysis.
AES is a symmetric key algorithm and offers higher security compared to
DES. The simplicity of its design results in efficient implementations on soft-
ware platforms. In this paper we try to improve its performance by adapting
the bitslice techniques used in DES to AES. We first review the AES algorithm.
We then present our implementation of AES encryption using the bitslice tech-
nique. In the next section we discuss architecture features of the microprocessor
which impact the performance of the encryption. We discuss the Intel Pentium 4
(with EM64T), AMD Athlon 64 and the Intel Core 2 microprocessors. All these
microprocessors support 64-bit integer operations and 128-bit SIMD operations.
The SIMD operations are supported by the Streaming SIMD Extensions (SSE)
instructions. The fourth section has the mode of operation of the ciphers, the
fifth has the related work followed by the conclusion in the final section.

1.1 The AES Algorithm

The AES algorithm operates on a 4×4 matrix of bytes called state. The state un-
dergoes a series of transformations during the encryption process [Algorithm:1].
Each iteration in the encryption process is called a round. The number of rounds
(Nr ) is determined by the size of the AES key. Nr = 10, 12 or 14 for key sizes
of 128, 192 or 256 bits respectively. All operations on the state are in the Galois
Field GF (28 ). The SubstituteByte function substitutes each byte with a value
from a lookup table called Sbox. The entries in the Sbox are obtained by taking
the inverse of each element in GF (28 ) followed by a linear affine transformation.
The ShiftRow function shifts each byte in the row by an offset. The MixColumn

Algorithm 1. AES Encryption


Input: 4 × 4 Plaintext bytes
Output: 4 × 4 Cyphertext bytes
1 AddInitialKey
2 for round = 1 to Nr do
3 SubstituteByte
4 ShiftRow
5 MixColumn
6 AddRoundKey
7 end
8 SubstituteByte
9 ShiftRow
10 AddRoundKey

Common questions

Powered by AI

The architecture of a microprocessor affects the performance of the bitslice implementation of AES by influencing how efficiently it can perform logical bit operations and utilize features like SIMD. For instance, processors like the Intel Pentium 4, AMD Athlon 64, and Intel Core 2 support 64-bit integer operations and 128-bit SIMD operations through SSE instructions . These capabilities allow for optimized use of superscalar architecture, making the bitslice implementation more efficient .

AES is preferred over DES because it offers higher security, better efficiency, and simplicity . AES supports larger key sizes of 128, 192, and 256 bits compared to DES's 56-bit key, making it more resistant to brute-force attacks . Additionally, its simple design facilitates efficient implementations on software platforms, crucial for network applications requiring high-speed encryption and decryption .

In a bitslice implementation on a 64-bit microprocessor, each bit in the register can act as a separate 1-bit processor. This setup enables the execution of 64 parallel DES encryptions simultaneously, substantially increasing the overall throughput compared to traditional implementations that do not exploit such parallelism . This parallel processing capability significantly enhances performance, making it the most efficient software implementation of DES .

The SubstituteByte function transforms the state matrix by substituting each byte with a value from a predefined lookup table called the Sbox . This substitution is significant because the Sbox values are derived from taking the inverse of each byte in the Galois Field GF(2^8), then applying a linear affine transformation. This transformation introduces non-linearity and complexity in the encryption process, enhancing the security of the cipher .

The bitslice implementation of AES has several advantages over traditional methods. Firstly, it improves throughput significantly as it allows parallel encryptions on microprocessors, which enhances performance . Secondly, it is immune to cache-timing attacks as it does not rely on tables for performance improvements, avoiding vulnerabilities associated with memory access patterns . This immunity to cache-timing analysis enhances the security of the implementation .

Bitslice approach to AES addresses the problem of cache-timing attacks by not using lookup tables, which are susceptible to such attacks due to their predictable memory access patterns . Since the bitslice method relies solely on logical operations (XOR, AND, OR, NOT) without tables, it avoids revealing timing information through memory accesses. This neutralizes the risk posed by cache-timing analysis, making the implementation inherently more secure against such cryptanalysis attacks .

AES performs a series of operations on the 4x4 matrix of bytes known as the state. The sequence starts with an AddInitialKey operation, followed by a series of rounds consisting of SubstituteByte, ShiftRow, MixColumn, and AddRoundKey operations. The SubstituteByte operation introduces non-linearity, the ShiftRow changes position, MixColumn increases diffusion among columns, and AddRoundKey mixes the key with the state. The final round omits the MixColumn step. These operations together ensure security by providing confusion and diffusion throughout the encryption process .

The key size in AES directly impacts the number of rounds in the encryption process, with 128-bit keys requiring 10 rounds, 192-bit keys needing 12 rounds, and 256-bit keys using 14 rounds . The number of rounds is significant because it affects the algorithm's security and performance. More rounds increase the complexity and security of the encryption, making it more resistant to attacks. However, this also adds computational overhead, impacting performance. Thus, the choice of key size is a balance between desired security levels and acceptable performance .

Bitslice DES's unique characteristic of performing parallel encryptions by treating each bit as a processor can be adapted to AES to enhance performance on processors with wide registers and SIMD capabilities . On processors like the Intel Core 2, which support 64-bit integer and 128-bit SIMD operations, bitslice AES can use these operations to effectively handle multiple encryption tasks in parallel. By optimizing logical operations and leveraging SIMD extensions efficiently, the bitslice method enhances processing speeds and secures the AES implementation against timing attacks, imitating the strengths of DES .

SIMD (Single Instruction, Multiple Data) operations play a crucial role in optimizing bitslice AES implementation on modern processors by allowing the simultaneous processing of multiple data points with a single instruction. Processors like Intel Core 2 support 128-bit SIMD operations through Streaming SIMD Extensions (SSE), enabling efficient parallel processing of bits across different parts of the encryption process. This optimization leverages the architecture's ability to handle multiple data streams, thereby improving the speed and efficiency of the AES implementation .

You might also like