OpenCores
URL https://opencores.org/ocsvn/aes_decrypt_fpga/aes_decrypt_fpga/trunk

Subversion Repositories aes_decrypt_fpga

[/] [aes_decrypt_fpga/] [trunk/] [rtl/] [verilog/] [InvMixColumns.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 schengopen
////////////////////////////////////////////////////////////////// ////
2
////                                                                                                                            ////
3
//// AES Decryption Core for FPGA                                                                       ////
4
////                                                                                                                            ////
5
//// This file is part of the AES Decryption Core for FPGA project      ////
6
//// http://www.opencores.org/cores/xxx/                                                        ////
7
////                                                                                                                            ////
8
//// Description                                                                                                        ////
9
//// Implementation of  AES Decryption Core for FPGA according to       ////
10
//// core specification document.                                                                       ////
11
////                                                                                                                            ////
12
//// To Do:                                                                                                             ////
13
//// -                                                                                                                          ////
14
////                                                                                                                            ////
15
//// Author(s):                                                                                                         ////
16
//// - scheng, schengopencores@opencores.org                                            ////
17
////                                                                                                                            ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                                                                                            ////
20
//// Copyright (C) 2009 Authors and OPENCORES.ORG                                       ////
21
////                                                                                                                            ////
22
//// This source file may be used and distributed without                       ////
23
//// restriction provided that this copyright statement is not          ////
24
//// removed from the file and that any derivative work contains        ////
25
//// the original copyright notice and the associated disclaimer.       ////
26
////                                                                                                                            ////
27
//// This source file is free software; you can redistribute it         ////
28
//// and/or modify it under the terms of the GNU Lesser General         ////
29
//// Public License as published by the Free Software Foundation;       ////
30
//// either version 2.1 of the License, or (at your option) any         ////
31
//// later version.                                                                                             ////
32
////                                                                                                                            ////
33
//// This source is distributed in the hope that it will be             ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied         ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR            ////
36
//// PURPOSE. See the GNU Lesser General Public License for more        ////
37
//// details.                                                                                                           ////
38
////                                                                                                                            ////
39
//// You should have received a copy of the GNU Lesser General          ////
40
//// Public License along with this source; if not, download it         ////
41
//// from http://www.opencores.org/lgpl.shtml                                           ////
42
////                                                                                                                            //// ///
43
///////////////////////////////////////////////////////////////////
44
////                                                                                                                            ////
45
//// InvMixColumns() as defined in section 5.3.3 of FIPS-197 spec,      ////
46
//// or feed input through to output when bypass=1.                                     ////
47
////                                                                                                                            ////
48
//// Feed through is used during the first and last round where         ////
49
//// InvMixColumns() is not needed.                                                                     ////
50
////                                                                                                                            ////
51
////////////////////////////////////////////////////////////////////////
52
module InvMixColumns(
53
        input   [0:127] din,
54
        output  [0:127] dout,
55
        input   bypass);
56
 
57
        wire    [0:31]  newcol [0:3];
58
 
59
        // 4 instances of InvMixCol_slice, each computes one column of InvMixColumns()
60
        //  as defined in section 5.3.3 of FIPS-197 spec.
61
        genvar j;
62
        generate
63
                for (j=0; j<4; j++)
64
                        InvMixCol_slice i_mixcol_u
65
                                (
66
                                .S0c(din[(32*j)+:8]),
67
                                .S1c(din[(32*j + 8)+:8]),
68
                                .S2c(din[(32*j + 16)+:8]),
69
                                .S3c(din[(32*j + 24)+:8]),
70
                                .bypass(bypass),
71
                                .new_S(newcol[j])
72
                                );
73
        endgenerate
74
 
75
        assign dout = {newcol[0], newcol[1],newcol[2], newcol[3]};
76
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.