КАТЕГОРИИ: Архитектура-(3434)Астрономия-(809)Биология-(7483)Биотехнологии-(1457)Военное дело-(14632)Высокие технологии-(1363)География-(913)Геология-(1438)Государство-(451)Демография-(1065)Дом-(47672)Журналистика и СМИ-(912)Изобретательство-(14524)Иностранные языки-(4268)Информатика-(17799)Искусство-(1338)История-(13644)Компьютеры-(11121)Косметика-(55)Кулинария-(373)Культура-(8427)Лингвистика-(374)Литература-(1642)Маркетинг-(23702)Математика-(16968)Машиностроение-(1700)Медицина-(12668)Менеджмент-(24684)Механика-(15423)Науковедение-(506)Образование-(11852)Охрана труда-(3308)Педагогика-(5571)Полиграфия-(1312)Политика-(7869)Право-(5454)Приборостроение-(1369)Программирование-(2801)Производство-(97182)Промышленность-(8706)Психология-(18388)Религия-(3217)Связь-(10668)Сельское хозяйство-(299)Социология-(6455)Спорт-(42831)Строительство-(4793)Торговля-(5050)Транспорт-(2929)Туризм-(1568)Физика-(3942)Философия-(17015)Финансы-(26596)Химия-(22929)Экология-(12095)Экономика-(9961)Электроника-(8441)Электротехника-(4623)Энергетика-(12629)Юриспруденция-(1492)Ядерная техника-(1748) |
Розроблення поведінкового опису пристрою
Схема розшифрування. Кінцева перестановка. Кінцева перестановка IP –1 діє на T16 і використовується для відновлення позиції. Вона є зворотньою до перестановки IP. Кінцева перестановка визначається таблицею: При розшифруванні даних всі дії виконуються в зворотному порядку. В 16 циклах розшифрування, на відміну від шифрування за допомогою прямого перетворення Фейстеля, тут використовується зворотне перетворення Фейстеля. Ri–1=Li Ключ ki, i=1,...,16, функція f, перестановка IP і IP –1 такі ж як і в процесі шифрування.
Переглянувши принцип функціонування алгоритма DES можна приступити до реалізації завдання по підстановці S – блоків.
library IEEE; use IEEE.STD_LOGIC_1164.all; entity S_Matrix is port (i:in STD_LOGIC_VECTOR(0 to 5); o:out STD_LOGIC_VECTOR(0 to 3)); end S_Matrix;
architecture S1 of S_Matrix is begin with i select o(0) <= '1' when "000000"|"000100"|"001010"|"001100"|"001110"|"010010"|"010110"|"011010"| "000011"|"001001"|"001101"|"010001"|"010101"|"010111"|"011001"|"011111"| "100100"|"100110"|"101000"|"101110"|"110000"|"110010"|"110100"|"111010"| "100001"|"100011"|"100101"|"101011"|"110011"|"110111"|"111001"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000010"|"000100"|"001010"|"010100"|"010110"|"011000"|"011110"| "000011"|"000101"|"000111"|"001001"|"001101"|"010011"|"010101"|"011011"| "100000"|"100100"|"101000"|"101010"|"110000"|"110010"|"110110"|"111100"| "100001"|"100011"|"101001"|"101111"|"110001"|"110111"|"111101"|"111111", '0' when others; with i select o(2) <= '1' when "000000"|"001000"|"001010"|"001100"|"010000"|"010010"|"010100"|"011110"| "000011"|"000101"|"001001"|"001011"|"010001"|"010011"|"010111"|"011101"| "100100"|"101010"|"101100"|"101110"|"110000"|"110110"|"111000"|"111010"| "100001"|"100111"|"101111"|"110011"|"110101"|"110111"|"111001"|"111101", '0' when others; with i select o(3) <= '1' when "000100"|"000110"|"001010"|"001100"|"010000"|"011000"|"011010"|"011110"| "000011"|"000101"|"001101"|"001111"|"010111"|"011001"|"011011"|"011101"| "100010"|"101000"|"101110"|"110000"|"110100"|"110110"|"111000"|"111100"| "100001"|"101011"|"101101"|"101111"|"110001"|"110011"|"110101"|"111111", '0' when others; end S1;
architecture S2 of S_Matrix is begin with i select o(0) <= '1' when "000000"|"000100"|"000110"|"001010"|"010000"|"010110"|"011000"|"011110"| "000011"|"001001"|"001101"|"001111"|"010001"|"010111"|"011011"|"011101"| "100010"|"100110"|"101000"|"101100"|"110010"|"110100"|"111000"|"111110"| "100001"|"100011"|"100101"|"101011"|"110001"|"110111"|"111101"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000110"|"001000"|"001110"|"010010"|"010110"|"011000"|"011100"| "000011"|"000101"|"000111"|"001001"|"001111"|"010001"|"011001"|"011111"| "100010"|"100100"|"101010"|"101100"|"110000"|"110100"|"110110"|"111110"| "100001"|"101011"|"101101"|"110011"|"110101"|"110111"|"111011"|"111101", '0' when others; with i select o(2) <= '1' when "000000"|"000110"|"001000"|"001010"|"001100"|"010010"|"010100"|"011110"| "000001"|"000111"|"001001"|"001011"|"001111"|"010111"|"011001"|"011101"| "100010"|"100100"|"100110"|"101000"|"110110"|"111010"|"111100"|"111110"| "100101"|"101001"|"101011"|"101111"|"110001"|"110011"|"110101"|"111101", '0' when others; with i select o(3) <= '1' when "000000"|"000010"|"001010"|"001100"|"010000"|"010010"|"010110"|"011100"| "000001"|"000011"|"000111"|"001001"|"010101"|"011011"|"011101"|"011111"| "100100"|"100110"|"101100"|"101110"|"110000"|"111000"|"111010"|"111110"| "100001"|"100111"|"101001"|"101011"|"110001"|"110101"|"111011"|"111111", '0' when others; end S2;
architecture S3 of S_Matrix is begin with i select o(0) <= '1' when "000000"|"000100"|"000110"|"001100"|"010010"|"010100"|"011000"|"011110"| "000001"|"000111"|"001111"|"010011"|"010111"|"011001"|"011011"|"011101"| "100000"|"100110"|"101000"|"101010"|"110000"|"110110"|"111010"|"111100"| "100011"|"100101"|"101011"|"101101"|"110011"|"110101"|"111001"|"111111", '0' when others; with i select o(1) <= '1' when "000110"|"001000"|"001100"|"001110"|"010010"|"010100"|"010110"|"011010"| "000001"|"000011"|"001011"|"001101"|"010101"|"010111"|"011001"|"011101"| "100000"|"100010"|"100100"|"101010"|"110110"|"111000"|"111100"|"111110"| "100101"|"101001"|"101111"|"110001"|"110011"|"110101"|"111011"|"111111", '0' when others; with i select o(2) <= '1' when "000000"|"000110"|"001000"|"001010"|"001100"|"010110"|"011000"|"011100"| "000011"|"001001"|"001101"|"001111"|"010001"|"010111"|"011011"|"011101"| "100010"|"101010"|"101100"|"110000"|"110100"|"111010"|"111100"|"111110"| "100011"|"101001"|"101111"|"110011"|"110101"|"110111"|"111001"|"111101", '0' when others; with i select o(3) <= '1' when "000100"|"001010"|"001100"|"001110"|"010000"|"010010"|"010110"|"011000"| "000001"|"000011"|"000111"|"001001"|"010101"|"011011"|"011101"|"011111"| "100000"|"100110"|"101010"|"101100"|"110000"|"110010"|"111000"|"111110"| "100001"|"100101"|"101011"|"101111"|"110011"|"110111"|"111001"|"111011", '0' when others; end S3;
architecture S4 of S_Matrix is begin with i select o(0) <= '1' when "000010"|"000100"|"001100"|"001110"|"010100"|"011000"|"011010"|"011110"| "000001"|"000011"|"000101"|"001011"|"010111"|"011011"|"011101"|"011111"| "100000"|"100100"|"101000"|"101010"|"101110"|"110000"|"110110"|"111100"| "100011"|"101001"|"101101"|"101111"|"110001"|"110111"|"111001"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000010"|"000100"|"001010"|"010110"|"011010"|"011100"|"011110"| "000001"|"000111"|"001001"|"001011"|"010001"|"010011"|"010111"|"011101"| "100010"|"101000"|"101100"|"101110"|"110000"|"110110"|"111000"|"111110"| "100011"|"100111"|"101101"|"110011"|"110101"|"111001"|"111011"|"111111", '0' when others; with i select o(2) <= '1' when "000000"|"000100"|"000110"|"001010"|"001110"|"010010"|"011000"|"011110"| "000101"|"001001"|"001011"|"001111"|"010011"|"010101"|"011011"|"011101"| "100000"|"100010"|"101010"|"101100"|"110000"|"110100"|"110110"|"111010"| "100001"|"100011"|"100111"|"101001"|"110111"|"111011"|"111101"|"111111", '0' when others; with i select o(3) <= '1' when "000000"|"000010"|"000110"|"001100"|"010000"|"010110"|"011000"|"011110"| "000001"|"000101"|"000111"|"001011"|"001111"|"010011"|"011001"|"011111"| "100100"|"101010"|"101100"|"101110"|"110000"|"110010"|"110100"|"111000"| "100001"|"100011"|"101011"|"101101"|"110001"|"110101"|"110111"|"111011", '0' when others; end S4;
architecture S5 of S_Matrix is begin with i select o(0) <= '1' when "000010"|"001010"|"001100"|"010000"|"010110"|"011000"|"011100"|"011110"| "000001"|"000011"|"000111"|"001101"|"010101"|"010111"|"011011"|"011101"| "100110"|"101000"|"101010"|"101110"|"110000"|"110010"|"110100"|"111110"| "100001"|"100011"|"100101"|"101011"|"101111"|"110011"|"110111"|"111001", '0' when others; with i select o(1) <= '1' when "000010"|"000100"|"001000"|"001110"|"010010"|"010110"|"011000"|"011100"| "000001"|"000111"|"001001"|"001011"|"001101"|"010001"|"010101"|"011111"| "100000"|"101010"|"101100"|"110000"|"110100"|"110110"|"111000"|"111110"| "100101"|"100111"|"101011"|"101111"|"110001"|"110011"|"111011"|"111101", '0' when others; with i select o(2) <= '1' when "000000"|"001000"|"001010"|"001100"|"001110"|"010100"|"010110"|"011100"| "000001"|"000011"|"000101"|"001011"|"010101"|"010111"|"011001"|"011111"| "100010"|"100110"|"101000"|"101100"|"110000"|"111000"|"111010"|"111110"| "100001"|"100111"|"101011"|"101101"|"110001"|"110011"|"111001"|"111111", '0' when others; with i select o(3) <= '1' when "000110"|"001000"|"001100"|"010010"|"010100"|"010110"|"011000"|"011110"| "000011"|"001011"|"001101"|"001111"|"010001"|"010101"|"011001"|"011011"| "100100"|"100110"|"101010"|"101100"|"110000"|"110010"|"110110"|"111010"| "100001"|"100111"|"101001"|"101111"|"110011"|"110111"|"111101"|"111111", '0' when others; end S5;
architecture S6 of S_Matrix is begin with i select o(0) <= '1' when "000000"|"000100"|"000110"|"001000"|"001110"|"010010"|"011000"|"011110"| "000001"|"000011"|"001011"|"001101"|"010101"|"010111"|"011011"|"011111"| "100000"|"100010"|"100100"|"101010"|"101100"|"110110"|"111010"|"111100"| "100111"|"101001"|"101101"|"101111"|"110001"|"110011"|"111101"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000110"|"001100"|"010010"|"010110"|"011000"|"011010"|"011100"| "000011"|"000101"|"001001"|"001011"|"001111"|"010001"|"010101"|"010111"| "100010"|"100100"|"100110"|"101100"|"110000"|"110100"|"111010"|"111110"| "100001"|"100111"|"101011"|"101101"|"110011"|"110111"|"111001"|"111111", '0' when others; with i select o(2) <= '1' when "000100"|"000110"|"001010"|"001100"|"010100"|"011000"|"011010"|"011110"| "000001"|"000011"|"000111"|"001001"|"010001"|"010111"|"011011"|"011101"| "100010"|"100100"|"101000"|"101110"|"110000"|"110110"|"111100"|"111110"| "100011"|"100101"|"101101"|"101111"|"110001"|"110011"|"110111"|"111001", '0' when others; with i select o(3) <= '1' when "000010"|"000110"|"001000"|"010010"|"010100"|"011010"|"011100"|"011110"| "000011"|"001001"|"001101"|"001111"|"010011"|"010101"|"011011"|"011101"| "100000"|"100100"|"100110"|"101110"|"110000"|"111000"|"111010"|"111100"| "100011"|"101001"|"101011"|"101101"|"110001"|"110101"|"110111"|"111111", '0' when others; end S6;
architecture S7 of S_Matrix is begin with i select o(0) <= '1' when "000010"|"000110"|"001000"|"001100"|"001110"|"010010"|"010100"|"011010"| "000001"|"000101"|"001011"|"001111"|"010001"|"010111"|"011011"|"011101"| "100100"|"100110"|"101000"|"101110"|"110000"|"110010"|"110110"|"111100"| "100011"|"100101"|"100111"|"101101"|"110001"|"110111"|"111001"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000110"|"001000"|"001110"|"010010"|"010110"|"011000"|"011100"| "000001"|"000111"|"001001"|"010001"|"010101"|"010111"|"011011"|"011111"| "100010"|"100110"|"101000"|"101100"|"101110"|"110010"|"110100"|"111010"| "100001"|"100101"|"101011"|"101111"|"110011"|"110111"|"111001"|"111111", '0' when others; with i select o(2) <= '1' when "000010"|"000100"|"000110"|"001000"|"010000"|"010110"|"011010"|"011100"| "000101"|"000111"|"001111"|"010001"|"010011"|"011001"|"011011"|"011111"| "100100"|"101010"|"101100"|"101110"|"110000"|"110010"|"110100"|"111110"| "100001"|"100011"|"101101"|"101111"|"110111"|"111001"|"111011"|"111101", '0' when others; with i select o(3) <= '1' when "000010"|"001000"|"001110"|"010000"|"010100"|"010110"|"011000"|"011110"| "000001"|"000101"|"000111"|"001011"|"001101"|"010011"|"010101"|"011011"| "100000"|"100100"|"100110"|"101010"|"101100"|"110010"|"111010"|"111100"| "100011"|"100101"|"101001"|"101111"|"110001"|"110011"|"110111"|"111101", '0' when others; end S7;
architecture S8 of S_Matrix is begin with i select o(0) <= '1' when "000000"|"000100"|"001010"|"001100"|"010000"|"010010"|"010110"|"011100"| "000011"|"000101"|"000111"|"001001"|"010001"|"010111"|"011011"|"011101"| "100010"|"101000"|"101010"|"101100"|"110100"|"110110"|"111000"|"111110"| "100101"|"101011"|"101101"|"101111"|"110001"|"110011"|"110101"|"111111", '0' when others; with i select o(1) <= '1' when "000000"|"000110"|"001000"|"001010"|"010110"|"011000"|"011100"|"011110"| "000011"|"000101"|"001101"|"001111"|"010001"|"010011"|"010101"|"011011"| "100000"|"100100"|"101010"|"101100"|"110010"|"110110"|"111000"|"111100"| "100101"|"100111"|"101001"|"101111"|"110001"|"110011"|"111011"|"111101", '0' when others; with i select o(2) <= '1' when "000010"|"001000"|"001010"|"001100"|"010000"|"010100"|"010110"|"011110"| "000011"|"001001"|"001011"|"001101"|"010101"|"010111"|"011011"|"011111"| "100000"|"100010"|"101100"|"101110"|"110010"|"110100"|"111000"|"111010"| "100001"|"100101"|"100111"|"101011"|"110001"|"111001"|"111101"|"111111", '0' when others; with i select o(3) <= '1' when "000000"|"001010"|"001100"|"001110"|"010010"|"010100"|"011000"|"011110"| "000001"|"000011"|"000101"|"001011"|"001101"|"010011"|"010111"|"011101"| "100000"|"100010"|"100110"|"101000"|"110110"|"111000"|"111010"|"111100"| "100011"|"100111"|"101111"|"110001"|"110101"|"111001"|"111011"|"111111", '0' when others; end S8;
Список ідентифікаторів
Дата добавления: 2015-08-31; Просмотров: 288; Нарушение авторских прав?; Мы поможем в написании вашей работы! Нам важно ваше мнение! Был ли полезен опубликованный материал? Да | Нет |