diff options
Diffstat (limited to 'src/add_vhdltbc/i')
| -rw-r--r-- | src/add_vhdltbc/i/i-128/tb/top_tb.vhd | 22 | ||||
| -rw-r--r-- | src/add_vhdltbc/i/i-192/tb/top_tb.vhd | 16 | ||||
| -rw-r--r-- | src/add_vhdltbc/i/i-256/tb/top_tb.vhd | 16 | ||||
| -rw-r--r-- | src/add_vhdltbc/i/roundexe_liliput.vhd | 9 |
4 files changed, 31 insertions, 32 deletions
diff --git a/src/add_vhdltbc/i/i-128/tb/top_tb.vhd b/src/add_vhdltbc/i/i-128/tb/top_tb.vhd index 27e6a23..6f59a23 100644 --- a/src/add_vhdltbc/i/i-128/tb/top_tb.vhd +++ b/src/add_vhdltbc/i/i-128/tb/top_tb.vhd @@ -62,19 +62,19 @@ begin reset_i_s <= '0' , '1' after 50 ns; -----------Decrypt KEY128 TWEAK192 IN32---------- - decrypt_s <= '1'; - start_i_s <= '1' after 50 ns, '0' after 1200 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"03B0315ED898437EC5064A836411F802"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; - ----------RESULT X"000102030405060708090A0B0C0D0E0F"; + --decrypt_s <= '1'; + --start_i_s <= '1' after 50 ns, '0' after 1200 ns; --mettre start_i a 0 des lors que le chiffrement commence + --data_i_s <= X"03B0315ED898437EC5064A836411F802"; + --key_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + --tweak_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"0F0E0D0C0B0A09080706050403020100"; -----------------Encrypt KEY128 TWEAK192 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"000102030405060708090A0B0C0D0E0F"; - --tweak_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; + 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"0F0E0D0C0B0A09080706050403020100"; + key_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; ----------RESULT X"03B0315ED898437EC5064A836411F802"; end top_tb_arch; diff --git a/src/add_vhdltbc/i/i-192/tb/top_tb.vhd b/src/add_vhdltbc/i/i-192/tb/top_tb.vhd index e2a036c..a7ce0cd 100644 --- a/src/add_vhdltbc/i/i-192/tb/top_tb.vhd +++ b/src/add_vhdltbc/i/i-192/tb/top_tb.vhd @@ -64,18 +64,18 @@ begin -----------Decrypt KEY128 TWEAK192 IN32---------- decrypt_s <= '1'; start_i_s <= '1' after 50 ns, '0' after 1200 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"8BF74FFB8F07AAA2699EDB38163C5DBF"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; - ---------RESULT X"000102030405060708090Q0B0C0D0E0F"; + data_i_s <= X"BF5D3C1638DB9E69A2AA078FFB4FF78B"; + key_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + ---------RESULT X"0F0E0D0C0B0A09080706050403020100"; -----------------Encrypt KEY192 TWEAK192 IN32---------- -- decrypt_s <= '0'; -- start_i_s <= '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"000102030405060708090A0B0C0D0E0F1011121314151617"; - ----RESULT X"8BF74FFB8F07AAA2699EDB38163C5DBF"; + --data_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + --key_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + --tweak_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + ----RESULT X"BF5D3C1638DB9E69A2AA078FFB4FF78B"; end top_tb_arch; diff --git a/src/add_vhdltbc/i/i-256/tb/top_tb.vhd b/src/add_vhdltbc/i/i-256/tb/top_tb.vhd index bfc1da0..2dab780 100644 --- a/src/add_vhdltbc/i/i-256/tb/top_tb.vhd +++ b/src/add_vhdltbc/i/i-256/tb/top_tb.vhd @@ -63,18 +63,18 @@ begin -----------Decrypt KEY128 TWEAK192 IN32---------- decrypt_s <= '1'; start_i_s <= '1' after 50 ns, '0' after 1600 ns; --mettre start_i a 0 des lors que le chiffrement commence - data_i_s <= X"D983AA90BF6F3F40629CC0601BEFC8BC"; - key_i_s <= X"000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"; - tweak_i_s <= X"000102030405060708090A0B0C0D0E0F1011121314151617"; - ----------RESULT X"000102030405060708090Q0B0C0D0E0F"; + data_i_s <= X"BCC8EF1B60C09C62403F6FBF90AA8309"; + key_i_s <= X"1F1E1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100"; + tweak_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"0F0E0D0C0B0A09080706050403020100"; -----------------Encrypt KEY128 TWEAK192 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"000102030405060708090A0B0C0D0E0F1011121314151617"; - ----------RESULT X"D983AA90BF6F3F40629CC0601BEFC8BC"; + --data_i_s <= X"0F0E0D0C0B0A09080706050403020100"; + --key_i_s <= X"1F1E1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100"; + --tweak_i_s <= X"17161514131211100F0E0D0C0B0A09080706050403020100"; + ----------RESULT X"BCC8EF1B60C09C62403F6FBF90AA8309"; end top_tb_arch; diff --git a/src/add_vhdltbc/i/roundexe_liliput.vhd b/src/add_vhdltbc/i/roundexe_liliput.vhd index 6b834b6..a91fe79 100644 --- a/src/add_vhdltbc/i/roundexe_liliput.vhd +++ b/src/add_vhdltbc/i/roundexe_liliput.vhd @@ -73,9 +73,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"; - end generate; + 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; data_out_valid_o <= data_out_valid_s; @@ -98,12 +97,12 @@ begin --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; |
