1 |
2 |
jdoin |
-----------------------------------------------------------------------------------------------------------------------
|
2 |
6 |
jdoin |
-- Author: Jonny Doin, jdoin@opencores.org, jonnydoin@gmail.com, jonnydoin@gridvortex.com
|
3 |
2 |
jdoin |
--
|
4 |
6 |
jdoin |
-- Create Date: 09:56:30 05/06/2016
|
5 |
2 |
jdoin |
-- Module Name: sha256_Ki_rom
|
6 |
|
|
-- Project Name: sha256 processor
|
7 |
|
|
-- Target Devices: Spartan-6
|
8 |
|
|
-- Tool versions: ISE 14.7
|
9 |
|
|
-- Description:
|
10 |
|
|
--
|
11 |
|
|
-- Initial values for the hash result registers.
|
12 |
|
|
-- This module is modelled as a fixed value function.
|
13 |
|
|
-- It can be implemented as a local constant fixed value.
|
14 |
|
|
--
|
15 |
|
|
------------------------------ COPYRIGHT NOTICE -----------------------------------------------------------------------
|
16 |
6 |
jdoin |
--
|
17 |
|
|
-- This file is part of the SHA256 HASH CORE project http://opencores.org/project,sha256_hash_core
|
18 |
|
|
--
|
19 |
|
|
-- Author(s): Jonny Doin, jdoin@opencores.org, jonnydoin@gridvortex.com, jonnydoin@gmail.com
|
20 |
|
|
--
|
21 |
|
|
-- Copyright (C) 2016 Jonny Doin
|
22 |
|
|
-- -----------------------------
|
23 |
|
|
--
|
24 |
|
|
-- This source file may be used and distributed without restriction provided that this copyright statement is not
|
25 |
|
|
-- removed from the file and that any derivative work contains the original copyright notice and the associated
|
26 |
|
|
-- disclaimer.
|
27 |
|
|
--
|
28 |
|
|
-- This source file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
|
29 |
|
|
-- General Public License as published by the Free Software Foundation; either version 2.1 of the License, or
|
30 |
|
|
-- (at your option) any later version.
|
31 |
|
|
--
|
32 |
|
|
-- This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
33 |
|
|
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
34 |
|
|
-- details.
|
35 |
|
|
--
|
36 |
|
|
-- You should have received a copy of the GNU Lesser General Public License along with this source; if not, download
|
37 |
|
|
-- it from http://www.gnu.org/licenses/lgpl.txt
|
38 |
|
|
--
|
39 |
2 |
jdoin |
------------------------------ REVISION HISTORY -----------------------------------------------------------------------
|
40 |
|
|
--
|
41 |
|
|
-- 2016/05/22 v0.01.0010 [JD] started development. design of blocks and port interfaces.
|
42 |
|
|
-- 2016/06/05 v0.01.0090 [JD] all modules integrated. testbench for basic test vectors verification.
|
43 |
|
|
-- 2016/06/05 v0.01.0095 [JD] verification failed. misalignment of words in the datapath.
|
44 |
|
|
-- 2016/06/06 v0.01.0100 [JD] first simulation verification against NIST-FIPS-180-4 test vectors passed.
|
45 |
|
|
--
|
46 |
|
|
-----------------------------------------------------------------------------------------------------------------------
|
47 |
|
|
-- TODO
|
48 |
|
|
-- ====
|
49 |
|
|
--
|
50 |
|
|
--
|
51 |
|
|
-----------------------------------------------------------------------------------------------------------------------
|
52 |
|
|
library ieee;
|
53 |
|
|
use ieee.std_logic_1164.all;
|
54 |
|
|
use ieee.numeric_std.all;
|
55 |
|
|
|
56 |
|
|
entity sha256_ki_rom is
|
57 |
|
|
port (
|
58 |
8 |
jdoin |
K0_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
59 |
|
|
K1_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
60 |
|
|
K2_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
61 |
|
|
K3_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
62 |
|
|
K4_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
63 |
|
|
K5_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
64 |
|
|
K6_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
65 |
|
|
K7_o : out std_logic_vector (31 downto 0) := (others => 'U')
|
66 |
2 |
jdoin |
);
|
67 |
|
|
end sha256_ki_rom;
|
68 |
|
|
|
69 |
|
|
architecture behavioral of sha256_ki_rom is
|
70 |
|
|
begin
|
71 |
|
|
--=============================================================================================
|
72 |
|
|
-- CONSTANTS FOR Ki VALUES
|
73 |
|
|
--=============================================================================================
|
74 |
|
|
K0_o_proc: K0_o <= x"6A09E667";
|
75 |
|
|
K1_o_proc: K1_o <= x"BB67AE85";
|
76 |
|
|
K2_o_proc: K2_o <= x"3C6EF372";
|
77 |
|
|
K3_o_proc: K3_o <= x"A54FF53A";
|
78 |
|
|
K4_o_proc: K4_o <= x"510E527F";
|
79 |
|
|
K5_o_proc: K5_o <= x"9B05688C";
|
80 |
|
|
K6_o_proc: K6_o <= x"1F83D9AB";
|
81 |
|
|
K7_o_proc: K7_o <= x"5BE0CD19";
|
82 |
|
|
|
83 |
|
|
end behavioral;
|
84 |
|
|
|