Line 42... |
Line 42... |
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
------------------------------------------------------
|
------------------------------------------------------
|
-- 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 operation
|
-- Description: The MixColumns operation
|
-- Ports:
|
-- Ports:
|
Line 72... |
Line 72... |
use work.aes_pkg.all;
|
use work.aes_pkg.all;
|
|
|
entity mixcol is
|
entity 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);
|
Line 123... |
Line 124... |
t1 <= d1 xor in1;
|
t1 <= d1 xor in1;
|
t2 <= d2 xor in2;
|
t2 <= d2 xor in2;
|
t3 <= d3 xor in3;
|
t3 <= d3 xor in3;
|
|
|
xored <= in0 xor in1 xor in2 xor in3;
|
xored <= in0 xor in1 xor in2 xor in3;
|
process(clk)
|
process(clk,rst)
|
begin
|
begin
|
if(rising_edge(clk)) then
|
if(rst = '1') then
|
|
out0 <= X"00";
|
|
out1 <= X"00";
|
|
out2 <= X"00";
|
|
out3 <= X"00";
|
|
elsif(rising_edge(clk)) then
|
out0 <= xored xor t0 xor d1;
|
out0 <= xored xor t0 xor d1;
|
out1 <= xored xor t1 xor d2;
|
out1 <= xored xor t1 xor d2;
|
out2 <= xored xor t2 xor d3;
|
out2 <= xored xor t2 xor d3;
|
out3 <= xored xor t3 xor d0;
|
out3 <= xored xor t3 xor d0;
|
end if;
|
end if;
|