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

Subversion Repositories aes_decry_ip_128bit

[/] [aes_decry_ip_128bit/] [trunk/] [rtl/] [key_schd/] [Sub_4bytes.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 ghegde
--************************************************************
2
--Copyright 2015, Ganesh Hegde < ghegde@opencores.org >      
3
--                                                           
4
--This source file may be used and distributed without  
5
--restriction provided that this copyright statement is not 
6
--removed from the file and that any derivative work contains
7
--the original copyright notice and the associated disclaimer.
8
--
9
--This source is distributed in the hope that it will be
10
--useful, but WITHOUT ANY WARRANTY; without even the implied
11
--warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
--PURPOSE.  See the GNU Lesser General Public License for more
13
--details.
14
--
15
--You should have received a copy of the GNU Lesser General
16
--Public License along with this source; if not, download it
17
--from http://www.opencores.org/lgpl.shtml
18
--
19
--*************************************************************
20
 
21
--*************************************************************
22
--This module will perform byte substitution for the given input word.
23
--Logic type : Combinational
24
--*************************************************************
25
 
26
library ieee;
27
use ieee.std_logic_1164.all;
28
 
29
entity Sub_4bytes is
30
port(
31
     word_in: in std_logic_vector(31 downto 0);
32
         word_out: out std_logic_vector(31 downto 0)
33
     );
34
end Sub_4bytes;
35
 
36
architecture Sub_4bytes_beh of Sub_4bytes is
37
   signal b0,b1,b2,b3: std_logic_vector(7 downto 0);
38
   component Sbox
39
   port (
40
        data_in: in std_logic_vector(7 downto 0);
41
        data_out:out std_logic_vector(7 downto 0)
42
   );
43
   end component;
44
begin
45
   b0<=word_in(31 downto 24);
46
   b1<=word_in(23 downto 16);
47
   b2<=word_in(15 downto 8);
48
   b3<=word_in(7 downto 0);
49
 
50
   Inst1:Sbox
51
      port map(data_in=>b0,data_out=>word_out(31 downto 24));
52
   Inst2:Sbox
53
      port map(data_in=>b1,data_out=>word_out(23 downto 16));
54
   Inst3:Sbox
55
      port map(data_in=>b2,data_out=>word_out(15 downto 8));
56
   Inst4:Sbox
57
      port map(data_in=>b3,data_out=>word_out(7 downto 0));
58
 
59
end Sub_4bytes_beh;

powered by: WebSVN 2.1.0

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