1 |
4 |
gajos |
-----------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- Present - a lightweight block cipher project ----
|
4 |
|
|
---- ----
|
5 |
|
|
---- This file is part of the Present - a lightweight block ----
|
6 |
|
|
---- cipher project ----
|
7 |
|
|
---- http://www.http://opencores.org/project,present ----
|
8 |
|
|
---- ----
|
9 |
|
|
---- Description: ----
|
10 |
|
|
---- Permutation layer of Present decoder. Simple signal ----
|
11 |
|
|
---- mixing, but in inverse way as cipher. For more information see----
|
12 |
|
|
---- http://homes.esat.kuleuven.be/~abogdano/papers/ ----
|
13 |
|
|
---- present_ches07.pdf ----
|
14 |
|
|
---- To Do: ----
|
15 |
|
|
---- ----
|
16 |
|
|
---- Author(s): ----
|
17 |
|
|
---- - Krzysztof Gajewski, gajos@opencores.org ----
|
18 |
|
|
---- k.gajewski@gmail.com ----
|
19 |
|
|
---- ----
|
20 |
|
|
-----------------------------------------------------------------------
|
21 |
|
|
---- ----
|
22 |
|
|
---- Copyright (C) 2013 Authors and OPENCORES.ORG ----
|
23 |
|
|
---- ----
|
24 |
|
|
---- This source file may be used and distributed without ----
|
25 |
|
|
---- restriction provided that this copyright statement is not ----
|
26 |
|
|
---- removed from the file and that any derivative work contains ----
|
27 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
28 |
|
|
---- ----
|
29 |
|
|
---- This source file is free software; you can redistribute it ----
|
30 |
|
|
---- and-or modify it under the terms of the GNU Lesser General ----
|
31 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
32 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
33 |
|
|
---- later version. ----
|
34 |
|
|
---- ----
|
35 |
|
|
---- This source is distributed in the hope that it will be ----
|
36 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
37 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
38 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
39 |
|
|
---- details. ----
|
40 |
|
|
---- ----
|
41 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
42 |
|
|
---- Public License along with this source; if not, download it ----
|
43 |
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
44 |
|
|
---- ----
|
45 |
|
|
-----------------------------------------------------------------------
|
46 |
3 |
gajos |
library IEEE;
|
47 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
48 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
49 |
|
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
50 |
|
|
|
51 |
|
|
entity pLayer_inv is
|
52 |
|
|
generic(w_64 : integer := 64);
|
53 |
|
|
port (
|
54 |
|
|
input : in std_logic_vector(w_64-1 downto 0);
|
55 |
|
|
output : out std_logic_vector(w_64-1 downto 0)
|
56 |
|
|
);
|
57 |
|
|
end pLayer_inv;
|
58 |
|
|
|
59 |
|
|
architecture Behavioral of pLayer_inv is
|
60 |
|
|
begin
|
61 |
|
|
output(0) <= input(0);
|
62 |
|
|
output(1) <= input(16);
|
63 |
|
|
output(2) <= input(32);
|
64 |
|
|
output(3) <= input(48);
|
65 |
|
|
output(4) <= input(1);
|
66 |
|
|
output(5) <= input(17);
|
67 |
|
|
output(6) <= input(33);
|
68 |
|
|
output(7) <= input(49);
|
69 |
|
|
output(8) <= input(2);
|
70 |
|
|
output(9) <= input(18);
|
71 |
|
|
output(10) <= input(34);
|
72 |
|
|
output(11) <= input(50);
|
73 |
|
|
output(12) <= input(3);
|
74 |
|
|
output(13) <= input(19);
|
75 |
|
|
output(14) <= input(35);
|
76 |
|
|
output(15) <= input(51);
|
77 |
|
|
output(16) <= input(4);
|
78 |
|
|
output(17) <= input(20);
|
79 |
|
|
output(18) <= input(36);
|
80 |
|
|
output(19) <= input(52);
|
81 |
|
|
output(20) <= input(5);
|
82 |
|
|
output(21) <= input(21);
|
83 |
|
|
output(22) <= input(37);
|
84 |
|
|
output(23) <= input(53);
|
85 |
|
|
output(24) <= input(6);
|
86 |
|
|
output(25) <= input(22);
|
87 |
|
|
output(26) <= input(38);
|
88 |
|
|
output(27) <= input(54);
|
89 |
|
|
output(28) <= input(7);
|
90 |
|
|
output(29) <= input(23);
|
91 |
|
|
output(30) <= input(39);
|
92 |
|
|
output(31) <= input(55);
|
93 |
|
|
output(32) <= input(8);
|
94 |
|
|
output(33) <= input(24);
|
95 |
|
|
output(34) <= input(40);
|
96 |
|
|
output(35) <= input(56);
|
97 |
|
|
output(36) <= input(9);
|
98 |
|
|
output(37) <= input(25);
|
99 |
|
|
output(38) <= input(41);
|
100 |
|
|
output(39) <= input(57);
|
101 |
|
|
output(40) <= input(10);
|
102 |
|
|
output(41) <= input(26);
|
103 |
|
|
output(42) <= input(42);
|
104 |
|
|
output(43) <= input(58);
|
105 |
|
|
output(44) <= input(11);
|
106 |
|
|
output(45) <= input(27);
|
107 |
|
|
output(46) <= input(43);
|
108 |
|
|
output(47) <= input(59);
|
109 |
|
|
output(48) <= input(12);
|
110 |
|
|
output(49) <= input(28);
|
111 |
|
|
output(50) <= input(44);
|
112 |
|
|
output(51) <= input(60);
|
113 |
|
|
output(52) <= input(13);
|
114 |
|
|
output(53) <= input(29);
|
115 |
|
|
output(54) <= input(45);
|
116 |
|
|
output(55) <= input(61);
|
117 |
|
|
output(56) <= input(14);
|
118 |
|
|
output(57) <= input(30);
|
119 |
|
|
output(58) <= input(46);
|
120 |
|
|
output(59) <= input(62);
|
121 |
|
|
output(60) <= input(15);
|
122 |
|
|
output(61) <= input(31);
|
123 |
|
|
output(62) <= input(47);
|
124 |
|
|
output(63) <= input(63);
|
125 |
|
|
end Behavioral;
|