forked from RawanMostafa08/AES-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCombineKey.v
46 lines (36 loc) · 854 Bytes
/
CombineKey.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
module CombineKey# (parameter size=128)(input [size-1:0] keyin,output[128*(size/32 +7)-1:0] keyout);
localparam nr= size/32 +6;
localparam maxsize=128*(nr+1)-1;
wire flag[nr:0];
wire count[nr:0];
wire[3:0] Nr[nr:0];
wire[255:0] keyround[nr:0];
wire[255:0] keytemp[nr+1:0];
wire[127:0] kout[nr+1:0];
assign count[0]=1;
assign flag[0]=0;
assign keytemp[0][255-:size]=keyin[size-1:0];
genvar i;
generate
for (i=0; i<1; i=i+1)
begin : b1
assign Nr[i]=i+1;
keyexpansion uut(128'h2b7e151628aed2a6abf7158809cf4f3c,1,keyround[0],0,0,kout[0]);
//if(i%2==0)begin
//assign flag[i+1]=1;
//end
//else begin
//assign flag[i]=0;
//end
//
//if(i<=3)begin
//assign count[i+1]=i;
//end
//else begin
//assign count[i]=1;
//end
assign keytemp[i+1]=keyround[0];
assign keyout[127:0]=kout[0];
end
endgenerate
endmodule