summaryrefslogtreecommitdiff
path: root/src/add_vhdltbc/encryptdecrypt/store_rtk.vhd
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-26 15:20:53 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-26 15:44:53 +0100
commitef905e42e625f54ed5b9d9042387d9a8e2510fa0 (patch)
tree2a59d03ecb22c3d09a8ac2c438adc7aa464ad33d /src/add_vhdltbc/encryptdecrypt/store_rtk.vhd
parenta555bb68a86a8d57cd3cae3d5e3c14acfda6fd6d (diff)
downloadlilliput-ae-implem-ef905e42e625f54ed5b9d9042387d9a8e2510fa0.tar.xz
[implem-vhdl] Déplacement dans SOUMISSION_NIST
Diffstat (limited to 'src/add_vhdltbc/encryptdecrypt/store_rtk.vhd')
-rw-r--r--src/add_vhdltbc/encryptdecrypt/store_rtk.vhd37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/add_vhdltbc/encryptdecrypt/store_rtk.vhd b/src/add_vhdltbc/encryptdecrypt/store_rtk.vhd
new file mode 100644
index 0000000..0edf110
--- /dev/null
+++ b/src/add_vhdltbc/encryptdecrypt/store_rtk.vhd
@@ -0,0 +1,37 @@
+library IEEE;
+library work;
+use IEEE.numeric_std.ALL;
+use IEEE.STD_LOGIC_1164.ALL;
+use work.crypt_pack.ALL;
+
+
+entity store_rtk is
+ Port (
+ key_i : in type_key; -- Etat d'entrée
+ key_o : out type_key; -- Etat de sortie
+ round_number_i : in integer;
+ initroundkey_i : in std_logic;
+ clock_i : in std_logic; -- Permet de gérer la clock
+ reset_i : in std_logic);
+end store_rtk;
+
+architecture store_rtk_arch of store_rtk is
+
+signal store_rtk : type_stored_key;
+
+begin
+
+process(reset_i, clock_i) -- On définit ici un process car les fonctions ne doivent pas se faire en même temps
+begin
+ if(reset_i = '0') then
+ key_o <= (others => (others => (others => '0'))); --si rest_i est nul c'est que les valeurs de state_o sont nuls ;
+ elsif(clock_i'event and clock_i = '1') then -- Dans le cas d'un front descendant d'horloge state_o prend la valeur de state_i. On utilise un front descendant d'horloge pour un soucis de synchronisation avec sbox
+ store_rtk <=store_rtk;
+ if initroundkey_i='1' then
+ store_rtk(round_number_i) <= key_i;
+ end if;
+ key_o<= store_rtk(round_number_i);
+ end if;
+end process;
+
+end store_rtk_arch; \ No newline at end of file