-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaes.v
82 lines (68 loc) · 2.33 KB
/
aes.v
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
`timescale 1ns / 1ps
module aes (
input aclk, // Clock
input aresetn, // Asynchronous reset active low
//encryption side
input wire [127 : 0] key_enc, //for 1st block , when key ready input next block and high next
input wire key_init_enc, // then when last block is ready input next
output wire key_ready_enc,
input wire [127 : 0] input_block_enc,
output wire [127 : 0] output_block_enc,
output wire block_ready_enc,
input wire next_bolck_enc,
//decryption side
input wire [127 : 0] key_dec,
input wire key_init_dec,
output wire key_ready_dec,
input wire [127 : 0] input_block_dec,
output wire [127 : 0] output_block_dec,
output wire block_ready_dec,
input wire next_bolck_dec
);
//----------------------------------------------------------------
// Parameters.
//----------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------
// Internal wires and registers
//---------------------------------------------------------------------------------------------------------------------
wire keylen;
//----------------------------------------------------------------
// assignments for ports.
//----------------------------------------------------------------
assign keylen = 1'b0;
//---------------------------------------------------------------------------------------------------------------------
// Implementation
//---------------------------------------------------------------------------------------------------------------------
aes_encryption
#(
)aes_encryption_dut
(
.aclk(aclk),
.aresetn(aresetn),
.next(next_bolck_enc),
.keylen(keylen),
.key(key_enc),
.key_init(key_init_enc),
.key_ready(key_ready_enc),
.input_block(input_block_enc),
.output_block(output_block_enc),
.block_ready(block_ready_enc)
);
aes_decryption
#(
)aes_decryption_dut
(
.aclk(aclk),
.aresetn(aresetn),
.next(next_bolck_dec),
.keylen(keylen),
.key(key_dec),
.key_init(key_init_dec),
.key_ready(key_ready_dec),
.input_block(input_block_dec),
.output_block(output_block_dec),
.block_ready(block_ready_dec)
);
//----------------------------------------------------------------
//functions and sub functions.
endmodule //aes