cryptography ip-cores in vhdl / verilog
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.3 KiB

11 years ago
11 years ago
  1. -- ======================================================================
  2. -- AES encryption/decryption testbench
  3. -- tests according to NIST special publication
  4. -- Copyright (C) 2011 Torsten Meissner
  5. -------------------------------------------------------------------------
  6. -- This program is free software; you can redistribute it and/or modify
  7. -- it under the terms of the GNU General Public License as published by
  8. -- the Free Software Foundation; either version 2 of the License, or
  9. -- (at your option) any later version.
  10. -- This program is distributed in the hope that it will be useful,
  11. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. -- GNU General Public License for more details.
  14. -- You should have received a copy of the GNU General Public License
  15. -- along with this program; if not, write to the Free Software
  16. -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. -- ======================================================================
  18. library ieee;
  19. use ieee.std_logic_1164.all;
  20. use ieee.numeric_std.all;
  21. entity tb_aes is
  22. end entity tb_aes;
  23. architecture rtl of tb_aes is
  24. signal s_reset : std_logic := '0';
  25. signal s_clk : std_logic := '0';
  26. signal s_mode : std_logic := '0';
  27. signal s_key : std_logic_vector(0 to 127) := (others => '0');
  28. signal s_datain : std_logic_vector(0 to 127) := (others => '0');
  29. signal s_validin : std_logic := '0';
  30. signal s_dataout : std_logic_vector(0 to 127);
  31. signal s_validout : std_logic;
  32. component aes is
  33. port (
  34. reset_i : in std_logic;
  35. clk_i : in std_logic;
  36. mode_i : in std_logic;
  37. key_i : in std_logic_vector(0 TO 127);
  38. data_i : in std_logic_vector(0 TO 127);
  39. valid_i : in std_logic;
  40. data_o : out std_logic_vector(0 TO 127);
  41. valid_o : out std_logic
  42. );
  43. end component aes;
  44. begin
  45. s_clk <= not(s_clk) after 10 ns;
  46. s_reset <= '1' after 100 ns;
  47. i_aes : aes
  48. port map (
  49. reset_i => s_reset,
  50. clk_i => s_clk,
  51. mode_i => s_mode,
  52. key_i => s_key,
  53. data_i => s_datain,
  54. valid_i => s_validin,
  55. data_o => s_dataout,
  56. valid_o => s_validout
  57. );
  58. end architecture rtl;