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

Subversion Repositories aes_pipe

[/] [aes_pipe/] [trunk/] [rtl/] [vhdl/] [colmix.vhdl] - Diff between revs 5 and 9

Only display areas with differences | Details | Blame | View Log

Rev 5 Rev 9
----------------------------------------------------------------------
----------------------------------------------------------------------
----                                                              ----
----                                                              ----
---- Pipelined Aes IP Core                                        ----
---- Pipelined Aes IP Core                                        ----
----                                                              ----
----                                                              ----
---- This file is part of the Pipelined AES project               ----
---- This file is part of the Pipelined AES project               ----
---- http://www.opencores.org/cores/aes_pipe/                     ----
---- http://www.opencores.org/cores/aes_pipe/                     ----
----                                                              ----
----                                                              ----
---- Description                                                  ----
---- Description                                                  ----
---- Implementation of AES IP core according to                   ----
---- Implementation of AES IP core according to                   ----
---- FIPS PUB 197 specification document.                         ----
---- FIPS PUB 197 specification document.                         ----
----                                                              ----
----                                                              ----
---- To Do:                                                       ----
---- To Do:                                                       ----
----   -                                                          ----
----   -                                                          ----
----                                                              ----
----                                                              ----
---- Author:                                                      ----
---- Author:                                                      ----
----      - Subhasis Das, subhasis256@gmail.com                   ----
----      - Subhasis Das, subhasis256@gmail.com                   ----
----                                                              ----
----                                                              ----
----------------------------------------------------------------------
----------------------------------------------------------------------
----                                                              ----
----                                                              ----
---- Copyright (C) 2009 Authors and OPENCORES.ORG                 ----
---- Copyright (C) 2009 Authors and OPENCORES.ORG                 ----
----                                                              ----
----                                                              ----
---- This source file may be used and distributed without         ----
---- This source file may be used and distributed without         ----
---- restriction provided that this copyright statement is not    ----
---- restriction provided that this copyright statement is not    ----
---- removed from the file and that any derivative work contains ----
---- removed from the file and that any derivative work contains ----
---- the original copyright notice and the associated disclaimer. ----
---- the original copyright notice and the associated disclaimer. ----
----                                                              ----
----                                                              ----
---- This source file is free software; you can redistribute it   ----
---- This source file is free software; you can redistribute it   ----
---- and/or modify it under the terms of the GNU Lesser General   ----
---- and/or modify it under the terms of the GNU Lesser General   ----
---- Public License as published by the Free Software Foundation; ----
---- Public License as published by the Free Software Foundation; ----
---- either version 2.1 of the License, or (at your option) any   ----
---- either version 2.1 of the License, or (at your option) any   ----
---- later version.                                               ----
---- later version.                                               ----
----                                                              ----
----                                                              ----
---- This source is distributed in the hope that it will be       ----
---- This source is distributed in the hope that it will be       ----
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
---- PURPOSE. See the GNU Lesser General Public License for more ----
---- PURPOSE. See the GNU Lesser General Public License for more ----
---- details.                                                     ----
---- details.                                                     ----
----                                                              ----
----                                                              ----
---- You should have received a copy of the GNU Lesser General    ----
---- You should have received a copy of the GNU Lesser General    ----
---- Public License along with this source; if not, download it   ----
---- Public License along with this source; if not, download it   ----
---- from http://www.opencores.org/lgpl.shtml                     ----
---- from http://www.opencores.org/lgpl.shtml                     ----
----                                                              ----
----                                                              ----
----------------------------------------------------------------------
----------------------------------------------------------------------
------------------------------------------------------
------------------------------------------------------
-- Project: AESFast
-- Project: AESFast
-- Author: Subhasis
-- Author: Subhasis
-- Last Modified: 20/03/10
-- Last Modified: 25/03/10
-- Email: subhasis256@gmail.com
-- Email: subhasis256@gmail.com
------------------------------------------------------
------------------------------------------------------
--
--
-- Description: The MixColumns step
-- Description: The MixColumns step
-- Ports:
-- Ports:
--                      clk: System Clock
--                      clk: System Clock
--                      datain: Input State block
--                      datain: Input State block
--                      inrkey: Input round key for passing on 
--                      inrkey: Input round key for passing on 
--                              to the next stage, i.e. Addkey
--                              to the next stage, i.e. Addkey
--                      outrkey: Output round key to next stage
--                      outrkey: Output round key to next stage
--                      dataout: Output state block
--                      dataout: Output state block
------------------------------------------------------
------------------------------------------------------
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_unsigned.all;
 
 
library work;
library work;
use work.aes_pkg.all;
use work.aes_pkg.all;
 
 
entity colmix is
entity colmix is
port(
port(
        clk: in std_logic;
        clk: in std_logic;
 
        rst: in std_logic;
        datain: in datablock;
        datain: in datablock;
        inrkey: in datablock;
        inrkey: in datablock;
        outrkey: out datablock;
        outrkey: out datablock;
        dataout: out datablock
        dataout: out datablock
        );
        );
end colmix;
end colmix;
 
 
architecture rtl of colmix is
architecture rtl of colmix is
component mixcol is
component mixcol is
port(
port(
        clk: in std_logic;
        clk: in std_logic;
 
        rst: in std_logic;
        in0: in std_logic_vector(7 downto 0);
        in0: in std_logic_vector(7 downto 0);
        in1: in std_logic_vector(7 downto 0);
        in1: in std_logic_vector(7 downto 0);
        in2: in std_logic_vector(7 downto 0);
        in2: in std_logic_vector(7 downto 0);
        in3: in std_logic_vector(7 downto 0);
        in3: in std_logic_vector(7 downto 0);
        out0: out std_logic_vector(7 downto 0);
        out0: out std_logic_vector(7 downto 0);
        out1: out std_logic_vector(7 downto 0);
        out1: out std_logic_vector(7 downto 0);
        out2: out std_logic_vector(7 downto 0);
        out2: out std_logic_vector(7 downto 0);
        out3: out std_logic_vector(7 downto 0)
        out3: out std_logic_vector(7 downto 0)
        );
        );
end component;
end component;
 
 
begin
begin
        -- Do the mixcol operation on all the 4 columns
        -- Do the mixcol operation on all the 4 columns
        g0: for i in 3 downto 0 generate
        g0: for i in 3 downto 0 generate
                mix: mixcol port map(
                mix: mixcol port map(
                                                        clk => clk,
                                                        clk => clk,
 
                                                        rst => rst,
                                                        in0 => datain(0, i),
                                                        in0 => datain(0, i),
                                                        in1 => datain(1, i),
                                                        in1 => datain(1, i),
                                                        in2 => datain(2, i),
                                                        in2 => datain(2, i),
                                                        in3 => datain(3, i),
                                                        in3 => datain(3, i),
                                                        out0 => dataout(0, i),
                                                        out0 => dataout(0, i),
                                                        out1 => dataout(1, i),
                                                        out1 => dataout(1, i),
                                                        out2 => dataout(2, i),
                                                        out2 => dataout(2, i),
                                                        out3 => dataout(3, i)
                                                        out3 => dataout(3, i)
                                                        );
                                                        );
        end generate;
        end generate;
        process(clk)
        process(clk,rst)
        begin
        begin
                if(rising_edge(clk)) then
                if(rst = '1') then
 
                        outrkey <= zero_data;
 
                elsif(rising_edge(clk)) then
                        outrkey <= inrkey;
                        outrkey <= inrkey;
                end if;
                end if;
        end process;
        end process;
end rtl;
end rtl;
 
 

powered by: WebSVN 2.1.0

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