------------------------------------------------------------
-- Copyright: 2011 Integrated Sytems Laboratory, ETH Zurich
--            http://www.iis.ee.ethz.ch/~sha3
------------------------------------------------------------
-------------------------------------------------------------------------------
-- Title      : SHA Package
-- Project    : 
-------------------------------------------------------------------------------
-- File       : sha_pack.vhdl
-- Author     : Köppel Benedikt;Schnydrig Mathias  
-- Company    : Integrated Systems Laboratory, ETH Zurich
-- Created    : 2010-10-28
-- Last update: 2011-08-12
-- Platform   : ModelSim (simulation), Synopsys (synthesis)
-- Standard   : VHDL'87
-------------------------------------------------------------------------------
-- Description: Defines a few constants and types needed for SHA
-------------------------------------------------------------------------------
-- Copyright (c) 2010 Integrated Systems Laboratory, ETH Zurich
-------------------------------------------------------------------------------
-- Revisions  :
-- Date        Version  Author  Description
-- 2010-10-28  1.0      sem10h7 Created
-------------------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;

package shapkg is

  type h_arr is array (0 to 7) of std_logic_vector(31 downto 0);  -- Array to store the H(0..7) words and AtoH(0..7)
  type expmess_arr is array (0 to 15) of std_logic_vector(31 downto 0);  -- Array to store the expanded message. This is only 16 words, because we can delete all >kk-16 older words (don't need them anymore)
  type k_arr is array (0 to 63) of std_logic_vector(31 downto 0);  -- Array to store the inital K values

  constant H_INITIAL : h_arr := (X"6a09e667", X"bb67ae85", X"3c6ef372", X"a54ff53a", X"510e527f", X"9b05688c", X"1f83d9ab", X"5be0cd19");  -- initial values for Harr
  constant K_INITIAL : k_arr := (
    X"428a2f98", X"71374491", X"b5c0fbcf", X"e9b5dba5", X"3956c25b", X"59f111f1", X"923f82a4", X"ab1c5ed5",
    X"d807aa98", X"12835b01", X"243185be", X"550c7dc3", X"72be5d74", X"80deb1fe", X"9bdc06a7", X"c19bf174",
    X"e49b69c1", X"efbe4786", X"0fc19dc6", X"240ca1cc", X"2de92c6f", X"4a7484aa", X"5cb0a9dc", X"76f988da",
    X"983e5152", X"a831c66d", X"b00327c8", X"bf597fc7", X"c6e00bf3", X"d5a79147", X"06ca6351", X"14292967",
    X"27b70a85", X"2e1b2138", X"4d2c6dfc", X"53380d13", X"650a7354", X"766a0abb", X"81c2c92e", X"92722c85",
    X"a2bfe8a1", X"a81a664b", X"c24b8b70", X"c76c51a3", X"d192e819", X"d6990624", X"f40e3585", X"106aa070",
    X"19a4c116", X"1e376c08", X"2748774c", X"34b0bcb5", X"391c0cb3", X"4ed8aa4a", X"5b9cca4f", X"682e6ff3",
    X"748f82ee", X"78a5636f", X"84c87814", X"8cc70208", X"90befffa", X"a4506ceb", X"bef9a3f7", X"c67178f2");  -- initial values for K

  constant SHA_IV : std_logic_vector(255 downto 0) := X"6a09e667bb67ae853c6ef372a54ff53a510e527f9b05688c1f83d9ab5be0cd19";  -- fix to SHA IV start values

  constant HWIDTH : integer := 256;
  

end shapkg;


Generated on Tue Nov 22 15:16:34 CET 2011
Home