1 |
6 |
rudi |
/////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// DES CORE ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// Author: Rudolf Usselmann ////
|
6 |
|
|
//// rudi@asics.ws ////
|
7 |
|
|
//// ////
|
8 |
|
|
/////////////////////////////////////////////////////////////////////
|
9 |
|
|
//// ////
|
10 |
|
|
//// Copyright (C) 2001 Rudolf Usselmann ////
|
11 |
|
|
//// rudi@asics.ws ////
|
12 |
|
|
//// ////
|
13 |
|
|
//// This source file may be used and distributed without ////
|
14 |
|
|
//// restriction provided that this copyright statement is not ////
|
15 |
|
|
//// removed from the file and that any derivative work contains ////
|
16 |
|
|
//// the original copyright notice and the associated disclaimer.////
|
17 |
|
|
//// ////
|
18 |
|
|
//// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ////
|
19 |
|
|
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ////
|
20 |
|
|
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ////
|
21 |
|
|
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR ////
|
22 |
|
|
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
|
23 |
|
|
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ////
|
24 |
|
|
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ////
|
25 |
|
|
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ////
|
26 |
|
|
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ////
|
27 |
|
|
//// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
|
28 |
|
|
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ////
|
29 |
|
|
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ////
|
30 |
|
|
//// POSSIBILITY OF SUCH DAMAGE. ////
|
31 |
|
|
//// ////
|
32 |
|
|
/////////////////////////////////////////////////////////////////////
|
33 |
|
|
|
34 |
|
|
|
35 |
7 |
rudi |
|
36 |
|
|
Triple DES Core
|
37 |
|
|
===============
|
38 |
|
|
Attached is a Triple DES core implementation in verilog. It takes
|
39 |
|
|
three standard 56 bit keys and 64 bits of data as input and generates
|
40 |
|
|
a 64 bit encrypted/decrypted result. Two implementations are provided:
|
41 |
|
|
|
42 |
|
|
1) Area Optimized (CBC Mode)
|
43 |
|
|
This is a sequential implementation and needs 48 cycles to complete
|
44 |
|
|
a full encryption/decryption cycle.
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
2) Performance Optimized (EBC Mode)
|
48 |
|
|
This is a pipelined implementation that has a 48 cycle pipeline
|
49 |
|
|
(plus 1 input and 1 output register). It can perform a complete
|
50 |
|
|
encryption/decryption every cycle.
|
51 |
|
|
|
52 |
|
|
Performance
|
53 |
|
|
===========
|
54 |
|
|
1) Area Optimized (CBC Mode)
|
55 |
|
|
0.18u UMC ASIC process: 5.5K gates, > 160 Mhz
|
56 |
|
|
Spartan IIe 100-6 : 1450 LUTs (about 60%), 88MHz
|
57 |
|
|
|
58 |
|
|
2) Performance Optimized (EBC Mode)
|
59 |
|
|
0.18u UMC ASIC process: 55K Gates, 300MHz (19.2 Gbits/sec)
|
60 |
|
|
Virtex-II-1500-6: 79% utilization, 166Mhz (10.6 Gbits/sec)
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
6 |
rudi |
DES Core
|
65 |
|
|
========
|
66 |
|
|
Attached is a DES core implementation in verilog. It takes a standard
|
67 |
|
|
56 bit key and 64 bits of data as input and generates a 64 bit
|
68 |
|
|
encrypted/decrypted result. Two implementations are provided:
|
69 |
|
|
|
70 |
|
|
1) Area Optimized (CBC Mode)
|
71 |
|
|
This is a sequential implementation and needs 16 cycles to complete
|
72 |
|
|
a full encryption/decryption cycle.
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
2) Performance Optimized (EBC Mode)
|
76 |
|
|
This is a pipelined implementation that has a 16 cycle pipeline
|
77 |
|
|
(plus 1 input and 1 output register). It can perform a complete
|
78 |
|
|
encryption/decryption every cycle.
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
Performance
|
82 |
|
|
===========
|
83 |
|
|
1) Area Optimized (CBC Mode)
|
84 |
|
|
0.18u UMC ASIC process: >155Mhz 3K Gates
|
85 |
|
|
Altera APEX 20KE-1: 1106 lcells >27MHz
|
86 |
|
|
Altera FLEX 10K50E-1: 1283 lcells >43MHz
|
87 |
|
|
|
88 |
|
|
2) Performance Optimized (EBC Mode)
|
89 |
|
|
0.18u UMC ASIC process: >290Mhz 28K Gates
|
90 |
|
|
Altera APEX 20KE-1: 6688 lcells >53MHz
|
91 |
|
|
Altera FLEX 10K130E-1: 6485 lcells >76 Mhz
|
92 |
|
|
|
93 |
|
|
|
94 |
7 |
rudi |
|
95 |
6 |
rudi |
Status
|
96 |
|
|
======
|
97 |
7 |
rudi |
31-Oct-2002 Added Triple DES
|
98 |
6 |
rudi |
05-Oct-2001 Added decrypt input (Thanks to Mark Cynar for
|
99 |
|
|
providing the code)
|
100 |
|
|
Reorganized directory structure
|
101 |
|
|
Added Makefile
|
102 |
|
|
Cleaned up test benches
|
103 |
|
|
03-Feb-2001 Initial Release
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
Directory Structure
|
107 |
|
|
===================
|
108 |
|
|
[core_root]
|
109 |
|
|
|
|
110 |
|
|
+-doc Documentation
|
111 |
|
|
|
|
112 |
|
|
+-bench--+ Test Bench
|
113 |
|
|
| +- verilog Verilog Sources
|
114 |
|
|
| +-vhdl VHDL Sources
|
115 |
|
|
|
|
116 |
|
|
+-rtl----+ Core RTL Sources
|
117 |
|
|
| +-verilog Verilog Sources
|
118 |
|
|
| +-vhdl VHDL Sources
|
119 |
|
|
|
|
120 |
|
|
+-sim----+
|
121 |
|
|
| +-rtl_sim---+ Functional verification Directory
|
122 |
|
|
| | +-bin Makefiles/Run Scripts
|
123 |
|
|
| | +-run Working Directory
|
124 |
|
|
| |
|
125 |
|
|
| +-gate_sim--+ Functional & Timing Gate Level
|
126 |
|
|
| | Verification Directory
|
127 |
|
|
| +-bin Makefiles/Run Scripts
|
128 |
|
|
| +-run Working Directory
|
129 |
|
|
|
|
130 |
|
|
+-lint--+ Lint Directory Tree
|
131 |
|
|
| +-bin Makefiles/Run Scripts
|
132 |
|
|
| +-run Working Directory
|
133 |
|
|
| +-log Linter log & result files
|
134 |
|
|
|
|
135 |
|
|
+-syn---+ Synthesis Directory Tree
|
136 |
|
|
| +-bin Synthesis Scripts
|
137 |
|
|
| +-run Working Directory
|
138 |
|
|
| +-log Synthesis log files
|
139 |
|
|
| +-out Synthesis Output
|
140 |
|
|
|
141 |
|
|
|
142 |
|
|
About the Author
|
143 |
|
|
================
|
144 |
|
|
To find out more about me (Rudolf Usselmann), please visit:
|
145 |
|
|
http://www.asics.ws
|