-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdes3_top.v
More file actions
44 lines (38 loc) · 1.06 KB
/
Copy pathdes3_top.v
File metadata and controls
44 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module des3_top (
input clock,
input rst,
input start,
input [63:0] key0,
input [63:0] key1,
input [63:0] key2,
input [63:0] plaintext_in,
output [63:0] ciphertext_out,
output [63:0] recovered_out,
output done_all
);
wire [63:0] internal_cipher;
wire encrypt_done;
des3_encrypt u_encrypt (
.clock (clock),
.rst (rst),
.select (start),
.key0 (key0),
.key1 (key1),
.key2 (key2),
.input_data (plaintext_in),
.output_data (internal_cipher),
.done (encrypt_done)
);
des3_decrypt u_decrypt (
.clock (clock),
.rst (rst),
.select (encrypt_done),
.key0 (key0),
.key1 (key1),
.key2 (key2),
.data_in (internal_cipher),
.data_out (recovered_out),
.done (done_all)
);
assign ciphertext_out = internal_cipher;
endmodule