Beruflich Dokumente
Kultur Dokumente
Report
Hardware Implementation of
An Encryption Algorithm
CONTENTS
I.
II.
III.
IV.
V.
2)
Preparation Question 1:
The variable Xi(1) is the input to the hardware, to be encrypted
or it is the input to the first round. Similarly Y i(9) is the output of
the encryption algorithm or the output of the output
transformation, where i = {1,2,3,4}
The output that feeds the input Xi(r+1) are the output of the
previous stage r i.e. Yi(r), where i ={1,2,3,4}
Preparation Question 2:
If either Xi or Zi are 0, then the corresponding inputs, a or b, are
set to 2n which consists of n+1 bits, else a and b are set to the
value of Xi and Zi with a zero appended to the MSB to make it
n+1 bits.
The number of bits needed to represent a and b in the range
{1,,2n} are n+1 bits. In worst case, the number of bits needed
to represent the product of a and b are 2n+1 bits.
The value of n for the modulo-multiplier in the IDEA Algorithm
is 16.
In modulo 2n operation, the n LSB bits remain and the next n+1
bits are masked. Thus, n bits are needed for the result of (ab
mod 2n).
The simple bit operation which is equivalent to (ab div 2n). The
bits MSB down to n of ab remain. After the division these bits
are positioned n down to 0. n+1 bits are needed to store the
result.
The result of (ab mod (2n+1)), if (ab mod 2n) = (ab div 2n) is zero.
This implies that the bits of ab from 2n down n and the bits
from n-1 down to 0 bits are identical (from the previous
answers) and the 2n+1 bit being 0. Using this result we can
represent ab as (2n+1)C where C = (ab mod 2n) = (ab div 2n).
Fig: Round Module spilt using two modulo multiplier and two adder
For this design, we would need two partial steps with each
partial step containing two modulo-multiplier and two adders
with some XORs.
The registers have to be inserted at the output of modulomultipliers, adders and the XORs of the each partial step.
The design for the datapath with 2 modulo-multipliers and two
adders can be found below.
Fig: Design for the datapath with 2 modulo-multipliers and two adders
DELAY ESTIMATION
4) Preparation Question 4:
Since a SLICE can perform two XOR operations, to perform a 16
bit XOR operation we require 8 SLICES.
5) Preparation Question 5:
Since the XOR operation is performed only by the F/G function
generators we consider the propagation delay of function
generator alone. Since the function generators are in parallel
and the SLICES operate in parallel, it takes 3ns to complete 16
Fig: Longest path in the clocked round is the path from the register R5 to R8.
1
1319261
2
3
4
10869565 1265822 312989
5
493827.2
2714
478
293
293
193/64
194/65
194/65
194/65
4005
2648.2
1068.2
1685.417
1) Direct Implementation:
The number of encryption is as calculated in the previous
answers.
From the LUT table, we know that number of LUTS for modulo
multiplier is 106, thus the number of SLICES is 53.
The number of SLICES for a XOR is 8, adder is 8, modulo
multiplier is 53. In a round module there are 6 XORs, 4 adders,
4 multipliers.
Number of SLICES per round = 8(6)+8(4)+53(4) = 292 SLICES. For
8 round it is 8(292) = 2336 SLICES.
Similarly for output transformation it takes 2 multipliers and 2
adders. Therefore the number of SLICES = 2(53)+2(8) = 122
SLICES.
The total number of SLICES for direct implementation =
2336+122 =2458 SLICES.
There are 4 inputs each being 16 bits thus 16*4 = 64 PINs and
128 bit input for key thus the input PINs are 64+128 = 192 PINs.
There are 4 output each being 16 bits thus 16*4 = 64 PINs.
Direct Implementation:
2) RCS 1
a. Control Path
b. Result
3) RSC2
a. Control Logic
c. Round Counter
d. Result
3) RSC2plus