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

Subversion Repositories aes_pipe

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

Show entire file | Details | Blame | View Log

Rev 5 Rev 9
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 AddKey step
-- Description: The AddKey step
-- Ports:
-- Ports:
Line 71... Line 71...
use work.aes_pkg.all;
use work.aes_pkg.all;
 
 
entity addkey is
entity addkey is
port(
port(
        clk: in std_logic;
        clk: in std_logic;
 
        rst: in std_logic;
        roundkey: in datablock;
        roundkey: in datablock;
        datain: in datablock;
        datain: in datablock;
        rcon: in std_logic_vector(7 downto 0);
        rcon: in std_logic_vector(7 downto 0);
        dataout: out datablock;
        dataout: out datablock;
        fc3: out blockcol;
        fc3: out blockcol;
Line 87... Line 88...
 
 
architecture rtl of addkey is
architecture rtl of addkey is
component keysched1 is
component keysched1 is
port(
port(
        clk: in std_logic;
        clk: in std_logic;
 
        rst: in std_logic;
        roundkey: in datablock;
        roundkey: in datablock;
        rcon: in std_logic_vector(7 downto 0);
        rcon: in std_logic_vector(7 downto 0);
        fc3: out blockcol;
        fc3: out blockcol;
        c0: out blockcol;
        c0: out blockcol;
        c1: out blockcol;
        c1: out blockcol;
Line 100... Line 102...
end component;
end component;
signal added: datablock;
signal added: datablock;
begin
begin
        step1: keysched1 port map(
        step1: keysched1 port map(
                                                         clk => clk,
                                                         clk => clk,
 
                                                         rst => rst,
                                                         roundkey => roundkey,
                                                         roundkey => roundkey,
                                                         rcon => rcon,
                                                         rcon => rcon,
                                                         fc3 => fc3,
                                                         fc3 => fc3,
                                                         c0 => c0,
                                                         c0 => c0,
                                                         c1 => c1,
                                                         c1 => c1,
Line 114... Line 117...
                g1: for j in 3 downto 0 generate
                g1: for j in 3 downto 0 generate
                        added(i,j) <= datain(i,j) xor roundkey(i,j);
                        added(i,j) <= datain(i,j) xor roundkey(i,j);
                end generate;
                end generate;
        end generate;
        end generate;
 
 
        process(clk)
        process(clk,rst)
        begin
        begin
                if(rising_edge(clk)) then
                if(rst = '1') then
 
                        dataout <= zero_data;
 
                elsif(rising_edge(clk)) then
                        dataout <= added;
                        dataout <= added;
                end if;
                end if;
        end process;
        end process;
end rtl;
end rtl;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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