diff options
| author | Gaetan Leplus <gaetan.leplus@airbus.com> | 2019-07-05 09:36:34 +0200 |
|---|---|---|
| committer | Gaetan Leplus <gaetan.leplus@airbus.com> | 2019-07-05 09:36:34 +0200 |
| commit | 26695bc39ab84d42897b7e516b3c66ddf3385937 (patch) | |
| tree | f85a6df650a15825de89689188ae01854ffac371 /src/add_vhdltbc/ii | |
| parent | d560b7c442c950a59cea691d90abdd42a35b9bf1 (diff) | |
| download | lilliput-ae-implem-26695bc39ab84d42897b7e516b3c66ddf3385937.tar.xz | |
Correction de la double inversion des entrées et de la création des tableaux
Diffstat (limited to 'src/add_vhdltbc/ii')
| -rw-r--r-- | src/add_vhdltbc/ii/ii-128/tb/top_tb.vhd | 9 | ||||
| -rw-r--r-- | src/add_vhdltbc/ii/ii-192/tb/top_tb.vhd | 8 | ||||
| -rw-r--r-- | src/add_vhdltbc/ii/ii-256/tb/top_tb.vhd | 9 | ||||
| -rw-r--r-- | src/add_vhdltbc/ii/roundexe_liliput.vhd | 8 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/add_vhdltbc/ii/ii-128/tb/top_tb.vhd b/src/add_vhdltbc/ii/ii-128/tb/top_tb.vhd index 05c1173..1842443 100644 --- a/src/add_vhdltbc/ii/ii-128/tb/top_tb.vhd +++ b/src/add_vhdltbc/ii/ii-128/tb/top_tb.vhd @@ -63,10 +63,11 @@ begin -----------------KEY128 TWEAK128 IN32---------- decrypt_s <= '0'; start_i_s <= '0','1' after 50 ns, '0' after 800 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"000102030405060708090A0B0C0D0E0F"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F"; - ----------RESULT X"0E00DD58BA4110FCA88DA6EDCA38D95D"; + data_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + key_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"5DD938CAEDA68DA8FC1041BA58DD000E"; + end top_tb_arch; diff --git a/src/add_vhdltbc/ii/ii-192/tb/top_tb.vhd b/src/add_vhdltbc/ii/ii-192/tb/top_tb.vhd index 51b4a67..231a0eb 100644 --- a/src/add_vhdltbc/ii/ii-192/tb/top_tb.vhd +++ b/src/add_vhdltbc/ii/ii-192/tb/top_tb.vhd @@ -63,10 +63,10 @@ begin -----------------KEY192 TWEAK128 IN32---------- decrypt_s <= '0'; start_i_s <= '0','1' after 50 ns, '0' after 1200 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"000102030405060708090A0B0C0D0E0F"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F"; - ----------RESULT X"3B87B86C8A12B38497C3F848D83F2049"; + data_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + key_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"49203FD848F8C39784B3128A6CB8873B"; end top_tb_arch; diff --git a/src/add_vhdltbc/ii/ii-256/tb/top_tb.vhd b/src/add_vhdltbc/ii/ii-256/tb/top_tb.vhd index 02e523e..5b9e14e 100644 --- a/src/add_vhdltbc/ii/ii-256/tb/top_tb.vhd +++ b/src/add_vhdltbc/ii/ii-256/tb/top_tb.vhd @@ -63,11 +63,10 @@ begin -----------------KEY256 TWEAK128 IN32---------- decrypt_s <= '0'; start_i_s <= '0','1' after 50 ns, '0' after 1600 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"000102030405060708090A0B0C0D0E0F"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F"; - ----------RESULT X"0ABDC2042F9FDBC1E4E0C96F059B717E"; - + data_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + key_i_s <= X"1F1E1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"7E719B056FC9E0E4C1DB9F2F04C2BD0A"; end top_tb_arch; diff --git a/src/add_vhdltbc/ii/roundexe_liliput.vhd b/src/add_vhdltbc/ii/roundexe_liliput.vhd index d407f6a..f04509f 100644 --- a/src/add_vhdltbc/ii/roundexe_liliput.vhd +++ b/src/add_vhdltbc/ii/roundexe_liliput.vhd @@ -71,8 +71,8 @@ begin convertion_ligne : for i in 0 to 3 generate convertion_colonne : for j in 0 to 3 generate - data_i_s(i)(j) <= data_i(127-8*(j+(4*i))downto 120-8*(j+(4*i))); - data_o(127-8*(j+(4*i))downto 120-8*(j+(4*i))) <= state_o_s(i)(j) when data_out_valid_s = '1' else X"00"; + data_i_s(i)(j) <= data_i((7+(8*(4*i+j)))downto((8*(4*i+j)))); + data_o(7+(8*(4*i+j)) downto (8*(4*i+j))) <= state_o_s(i)(j) when data_out_valid_s = '1' else X"00"; end generate; end generate; @@ -95,12 +95,12 @@ begin end process reg_roundkey; --Tweak_key concatenation - tweak_key_i (TWEAK_KEY_LEN downto 0) <= tweak_i & keyb_i; + tweak_key_i (TWEAK_KEY_LEN downto 0) <= keyb_i & tweak_i; --formatting tweak_key in type_tweak_key_array convertion_ligne_key : for i in 0 to LANE_NB-1 generate convertion_colonne_key : for j in 0 to 7 generate - tk_s(i)(j) <= tweak_key_i( (TWEAK_KEY_LEN)-8*(8*i+j)downto TWEAK_KEY_LEN-7-8*(8*i+j)); + tk_s(i)(j) <= tweak_key_i(((64*i)+(8*j)+7)downto((64*i)+(8*j))); end generate; end generate; |
