blob: 46f757e27d01811d362461b8bece3a81bd99e212 (
plain)
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
|
library IEEE;
library work;
use IEEE.std_logic_1164.all;
entity inner_sbox_b is
port(
sbox_i : in std_logic_vector(3 downto 0);
sbox_o : out std_logic_vector(3 downto 0)
);
end inner_sbox_b;
architecture inner_sbox_b_arch of inner_sbox_b is
signal a,b,c,d,x,y,z,t :std_logic;
signal c1,d1 :std_logic;
begin
a <= sbox_i(3);
b <= sbox_i(2);
c <= sbox_i(1);
d <= sbox_i(0);
c1 <= c xor (a and d);
d1 <= b xor (d and c);
x <= d xor (a and d1);
y <= d1;
z <= a xor (c1 and d1);
t <= c1;
sbox_o(3) <= x;
sbox_o(2) <= y;
sbox_o(1) <= z;
sbox_o(0) <= t;
end;
|