-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rijndael_mult.vhd
executable file
·54 lines (43 loc) · 1.29 KB
/
Rijndael_mult.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 11:33:09 04/17/2009
-- Design Name:
-- Module Name: Rijndael_mult - RTL
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Rijndael_step_mult is
Port ( ain : in STD_LOGIC_VECTOR (7 downto 0);
bin : in STD_LOGIC_VECTOR (7 downto 0);
pin : in STD_LOGIC_VECTOR (7 downto 0);
aout : out STD_LOGIC_VECTOR (7 downto 0);
bout : out STD_LOGIC_VECTOR (7 downto 0);
pout : out STD_LOGIC_VECTOR (7 downto 0));
end Rijndael_step_mult;
architecture RTL of Rijndael_step_mult is
signal a_shift : STD_LOGIC_VECTOR (7 downto 0);
signal b_shift : STD_LOGIC_VECTOR (7 downto 0);
begin
a_shift <= ain(6 downto 0) & '0';
b_shift <= '0' & bin(7 downto 1) ;
bout <= b_shift;
pout <= pin xor ain when bin(0) = '1' else
pin;
aout <= a_shift xor x"1b" when ain(7) = '1' else
a_shift;
end RTL;