|
@ -36,7 +36,7 @@ architecture rtl of tb_tdes is |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type t_array is array (natural range <>) of std_logic_vector(0 to 63); |
|
|
type t_array is array (natural range <>) of std_logic_vector(0 to 63); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constant c_table_test_plain : t_array(0 to 18) := |
|
|
constant c_table_test_plain : t_array(0 to 18) := |
|
|
(x"01A1D6D039776742", x"5CD54CA83DEF57DA", x"0248D43806F67172", |
|
|
(x"01A1D6D039776742", x"5CD54CA83DEF57DA", x"0248D43806F67172", |
|
|
x"51454B582DDF440A", x"42FD443059577FA2", x"059B5E0851CF143A", |
|
|
x"51454B582DDF440A", x"42FD443059577FA2", x"059B5E0851CF143A", |
|
@ -83,7 +83,7 @@ begin |
|
|
|
|
|
|
|
|
s_reset <= '1' after 100 ns; |
|
|
s_reset <= '1' after 100 ns; |
|
|
s_clk <= not(s_clk) after 10 ns; |
|
|
s_clk <= not(s_clk) after 10 ns; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
teststimuliP : process is |
|
|
teststimuliP : process is |
|
|
begin |
|
|
begin |
|
@ -93,6 +93,7 @@ begin |
|
|
s_key2 <= (others => '0'); |
|
|
s_key2 <= (others => '0'); |
|
|
s_key3 <= (others => '0'); |
|
|
s_key3 <= (others => '0'); |
|
|
s_datain <= (others => '0'); |
|
|
s_datain <= (others => '0'); |
|
|
|
|
|
wait until s_reset = '1'; |
|
|
-- ENCRYPTION TESTS |
|
|
-- ENCRYPTION TESTS |
|
|
-- cbc known answers test |
|
|
-- cbc known answers test |
|
|
for index in c_table_test_plain'range loop |
|
|
for index in c_table_test_plain'range loop |
|
@ -136,8 +137,8 @@ begin |
|
|
s_datain <= (others => '0'); |
|
|
s_datain <= (others => '0'); |
|
|
wait; |
|
|
wait; |
|
|
end process teststimuliP; |
|
|
end process teststimuliP; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testcheckerP : process is |
|
|
testcheckerP : process is |
|
|
begin |
|
|
begin |
|
|
report "# ENCRYPTION TESTS"; |
|
|
report "# ENCRYPTION TESTS"; |
|
@ -167,7 +168,7 @@ begin |
|
|
key2_i => s_key2, |
|
|
key2_i => s_key2, |
|
|
key3_i => s_key3, |
|
|
key3_i => s_key3, |
|
|
data_i => s_datain, |
|
|
data_i => s_datain, |
|
|
valid_i => s_validin, |
|
|
|
|
|
|
|
|
valid_i => s_validin, |
|
|
data_o => s_dataout, |
|
|
data_o => s_dataout, |
|
|
valid_o => s_validout, |
|
|
valid_o => s_validout, |
|
|
ready_o => s_ready |
|
|
ready_o => s_ready |
|
|