mixcol.v
1.4 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// This confidential and propriety software may be used
// only as authorized by a licensing agreement from
// Ocean Logic Pty Ltd http://www.ocean-logic.com
//
// In the event of publication, the following notice is
// applicable
//
// (C) COPYRIGHT 2001 Ocean Logic Pty Ltd
// ALL RIGHTS RESERVED
//
// the entire notice must be reproduced on all
// authorized copies
//
// File : mixcol.vhd
// Author : Vincenzo Liguori
// Date : 01-03-02
// Version 1.0
// Abstract :
// This implements the AES Mix col operation
//
// Modification history :
// Date by Version Change description
// -------------------------------------------------
// 01-03-02 VL 1.0 Original
module mixcol(
x,
do0,
do1,
do2,
do3
);
input[7:0] x;
output[7:0] do0, do1, do2, do3;
wire [7:0] x;
wire [7:0] do0;
wire [7:0] do1;
wire [7:0] do2;
wire [7:0] do3;
wire [7:0] x2;
wire [7:0] x4;
wire [7:0] x8;
wire [7:0] xc;
assign x2 = {x[6:4] ,x[3] ^ x[7] ,x[2] ^ x[7] ,x[1] ,x[0] ^ x[7] ,x[7] };
assign x4 = {x[5:4] ,x[3] ^ x[7] ,x[2] ^ x[7] ^ x[6] ,x[1] ^ x[6] ,x[0] ^ x[7] ,x[7] ^ x[6] ,x[6] };
assign x8 = {x[4] ,x[3] ^ x[7] ,x[2] ^ x[7] ^ x[6] ,x[1] ^ x[6] ^ x[5] ,x[0] ^ x[7] ^ x[5] ,x[7] ^ x[6] ,x[6] ^ x[5] ,x[5] };
assign xc = x4 ^ x8;
assign do0 = xc ^ x2;
assign do1 = x8 ^ x2 ^ x;
assign do2 = xc ^ x;
assign do3 = x8 ^ x;
endmodule