OpenCores
URL https://opencores.org/ocsvn/camellia-vhdl/camellia-vhdl/trunk

Subversion Repositories camellia-vhdl

[/] [camellia-vhdl/] [trunk/] [pipelining/] [sbox4.vhd] - Blame information for rev 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 pfulgoni
 
2
--------------------------------------------------------------------------------
3
-- Designer:      Paolo Fulgoni <pfulgoni@opencores.org>
4
--
5
-- Create Date:   09/14/2007
6 8 pfulgoni
-- Last Update:   04/14/2008
7 2 pfulgoni
-- Project Name:  camellia-vhdl
8
-- Description:   Dual-port SBOX4
9
--
10
-- Copyright (C) 2007  Paolo Fulgoni
11
-- This file is part of camellia-vhdl.
12
-- camellia-vhdl is free software; you can redistribute it and/or modify
13
-- it under the terms of the GNU General Public License as published by
14
-- the Free Software Foundation; either version 3 of the License, or
15
-- (at your option) any later version.
16
-- camellia-vhdl is distributed in the hope that it will be useful,
17
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
-- GNU General Public License for more details.
20
-- You should have received a copy of the GNU General Public License
21
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
--
23
-- The Camellia cipher algorithm is 128 bit cipher developed by NTT and
24
-- Mitsubishi Electric researchers.
25
-- http://info.isl.ntt.co.jp/crypt/eng/camellia/
26
--------------------------------------------------------------------------------
27
library IEEE;
28
use IEEE.std_logic_1164.all;
29
 
30
 
31
entity SBOX4 is
32
    port  (
33 7 pfulgoni
                clk   : IN  STD_LOGIC;
34
            addra : IN  STD_LOGIC_VECTOR(0 to 7);
35
            addrb : IN  STD_LOGIC_VECTOR(0 to 7);
36 2 pfulgoni
            douta : OUT STD_LOGIC_VECTOR(0 to 7);
37 7 pfulgoni
            doutb : OUT STD_LOGIC_VECTOR(0 to 7)
38 2 pfulgoni
            );
39
end SBOX4;
40
 
41
architecture RTL of SBOX4 is
42
 
43
    component SBOX1 is
44
        port  (
45 7 pfulgoni
                clk   : IN  STD_LOGIC;
46
                addra : IN  STD_LOGIC_VECTOR(0 to 7);
47
                addrb : IN  STD_LOGIC_VECTOR(0 to 7);
48 2 pfulgoni
                douta : OUT STD_LOGIC_VECTOR(0 to 7);
49 7 pfulgoni
                doutb : OUT STD_LOGIC_VECTOR(0 to 7)
50 2 pfulgoni
                );
51
    end component;
52
 
53
    -- SBOX1 signals
54
    signal s1_addra : STD_LOGIC_VECTOR(0 to 7);
55
    signal s1_addrb : STD_LOGIC_VECTOR(0 to 7);
56 7 pfulgoni
    signal s1_clk  : STD_LOGIC;
57 2 pfulgoni
    signal s1_douta : STD_LOGIC_VECTOR(0 to 7);
58
    signal s1_doutb : STD_LOGIC_VECTOR(0 to 7);
59
 
60
begin
61
 
62
    S1 : SBOX1
63 7 pfulgoni
        port map(s1_clk, s1_addra, s1_addrb, s1_douta, s1_doutb);
64 2 pfulgoni
 
65 7 pfulgoni
    s1_clk   <= clk;
66 8 pfulgoni
    s1_addra <= addra(1 to 7) & addra(0);
67
    s1_addrb <= addrb(1 to 7) & addrb(0);
68 2 pfulgoni
 
69
    douta <= s1_douta;
70
    doutb <= s1_doutb;
71
 
72
end RTL;

powered by: WebSVN 2.1.0

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