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.

46 lines
1.4 KiB

  1. library ieee ;
  2. use ieee.std_logic_1164.all;
  3. package uart_aes_ref is
  4. procedure cryptData(datain : in std_logic_vector(0 to 127);
  5. key : in std_logic_vector(0 to 127);
  6. iv : in std_logic_vector(0 to 127);
  7. start : in boolean;
  8. final : in boolean;
  9. dataout : out std_logic_vector(0 to 127);
  10. bytelen : in integer);
  11. attribute foreign of cryptData: procedure is "VHPIDIRECT cryptData";
  12. function swap (datain : std_logic_vector(0 to 127)) return std_logic_vector;
  13. end package;
  14. package body uart_aes_ref is
  15. procedure cryptData(datain : in std_logic_vector(0 to 127);
  16. key : in std_logic_vector(0 to 127);
  17. iv : in std_logic_vector(0 to 127);
  18. start : in boolean;
  19. final : in boolean;
  20. dataout : out std_logic_vector(0 to 127);
  21. bytelen : in integer) is
  22. begin
  23. report "VHPIDIRECT cryptData" severity failure;
  24. end procedure;
  25. function swap (datain : std_logic_vector(0 to 127)) return std_logic_vector is
  26. variable v_data : std_logic_vector(0 to 127);
  27. begin
  28. for i in 0 to 15 loop
  29. for y in 0 to 7 loop
  30. v_data((i*8)+y) := datain((i*8)+7-y);
  31. end loop;
  32. end loop;
  33. return v_data;
  34. end function;
  35. end package body;