OpenCores
URL https://opencores.org/ocsvn/mod_mult_exp/mod_mult_exp/trunk

Subversion Repositories mod_mult_exp

[/] [mod_mult_exp/] [trunk/] [rtl/] [vhdl/] [commons/] [properties_64bit.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gajos
-----------------------------------------------------------------------
2
----                                                               ----
3
---- Montgomery modular multiplier and exponentiator               ----
4
----                                                               ----
5
---- This file is part of the Montgomery modular multiplier        ----
6
---- and exponentiator project                                     ----
7
---- http://opencores.org/project,mod_mult_exp                     ----
8
----                                                               ----
9
---- Description:                                                  ----
10
----     Properties file for multiplier and exponentiator          ----
11
----     (64 bit).                                                ----
12
---- To Do:                                                        ----
13
----                                                               ----
14
---- Author(s):                                                    ----
15
---- - Krzysztof Gajewski, gajos@opencores.org                     ----
16
----                       k.gajewski@gmail.com                    ----
17
----                                                               ----
18
-----------------------------------------------------------------------
19
----                                                               ----
20
---- Copyright (C) 2014 Authors and OPENCORES.ORG                  ----
21
----                                                               ----
22
---- This source file may be used and distributed without          ----
23
---- restriction provided that this copyright statement is not     ----
24
---- removed from the file and that any derivative work contains   ----
25
---- the original copyright notice and the associated disclaimer.  ----
26
----                                                               ----
27
---- This source file is free software; you can redistribute it    ----
28
---- and-or modify it under the terms of the GNU Lesser General    ----
29
---- Public License as published by the Free Software Foundation;  ----
30
---- either version 2.1 of the License, or (at your option) any    ----
31
---- later version.                                                ----
32
----                                                               ----
33
---- This source is distributed in the hope that it will be        ----
34
---- useful, but WITHOUT ANY WARRANTY; without even the implied    ----
35
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR       ----
36
---- PURPOSE. See the GNU Lesser General Public License for more   ----
37
---- details.                                                      ----
38
----                                                               ----
39
---- You should have received a copy of the GNU Lesser General     ----
40
---- Public License along with this source; if not, download it    ----
41
---- from http://www.opencores.org/lgpl.shtml                      ----
42
----                                                               ----
43
-----------------------------------------------------------------------
44
 
45
library IEEE;
46
use IEEE.STD_LOGIC_1164.all;
47
 
48
package properties is
49
 
50
-- Declare constants
51
 
52
 constant BYTE             : INTEGER := 8;
53
 
54
constant WORD_LENGTH       : INTEGER := 64;
55
constant WORD_INTEGER     : INTEGER := 7;
56
constant WORD_INT_LOG     : INTEGER := 3;
57
constant WORD_INT_LOG_STR : STD_LOGIC_VECTOR(WORD_INT_LOG - 1 downto 0) := "111";
58
 
59
constant count_up : STD_LOGIC_VECTOR(1 downto 0) := "00";
60
constant count_down : STD_LOGIC_VECTOR(1 downto 0) := "01";
61
constant do_nothing : STD_LOGIC_VECTOR(1 downto 0) := "11";
62
 
63
type multiplier_states is (NOP, CALCULATE_START, STOP);
64
 
65
type finalizer_states is (FIRST_RUN, NOP,
66
    READ_DATA_HASH_M, READ_DATA_C1, READ_DATA_N, READ_DATA_E, READ_DATA_D2, READ_DATA_CINV,
67
    COUNT_C2, EXP_Z_C2, SAVE_EXP_Z_C2, EXP_P_C2, SAVE_EXP_P_C2, EXP_CONTROL_C2, EXP_END_C2, SAVE_EXP_MULT_C2,
68
         COUNT_Cinv, MULT_CINV, SAVE_MULT_CINV,
69
         COUNT_C, MULT_C, SAVE_MULT_C,
70
         COUNT_M, EXP_Z_M, SAVE_EXP_Z_M, EXP_P_M, SAVE_EXP_P_M, EXP_CONTROL_M, EXP_END_M, SAVE_EXP_M,
71
    MAKE_COMPARE, COMP, COMPARE_RESULT,
72
         INFO_RESULT, SHOW_RESULT, FAIL_STATE);
73
 
74
type fin_data_ctrl_states is (NOP, PAD_FAIL, PAD_FAIL_NOP, PAD_FAIL_DECODE,
75
    DECODE_IN, READ_DATA, DECODE_READ, DECODE_READ_PROP, MAKE_FINALIZE, OUTPUT_DATA, INFO_STATE,
76
    TEMPORARY_STATE, DATA_TO_OUT_PROPAGATE, DATA_TO_OUT_PROPAGATE2, MOVE_DATA, MOVE_OUTPUT_DATA);
77
 
78
---- mnemonics for finalizer
79
constant mn_read_hash_m      : STD_LOGIC_VECTOR(7 downto 0) := "00000001";
80
constant mn_read_c1          : STD_LOGIC_VECTOR(7 downto 0) := "00000010";
81
constant mn_read_n           : STD_LOGIC_VECTOR(7 downto 0) := "00000011";
82
constant mn_read_e           : STD_LOGIC_VECTOR(7 downto 0) := "00000100";
83
constant mn_read_d2          : STD_LOGIC_VECTOR(7 downto 0) := "00000110";
84
constant mn_read_cinv        : STD_LOGIC_VECTOR(7 downto 0) := "00000111";
85
constant mn_finalize         : STD_LOGIC_VECTOR(7 downto 0) := "00001000";
86
constant mn_show_result      : STD_LOGIC_VECTOR(7 downto 0) := "00001001";
87
constant mn_show_status      : STD_LOGIC_VECTOR(7 downto 0) := "00001010";
88
constant mn_prepare_for_data : STD_LOGIC_VECTOR(7 downto 0) := "00001011";
89
 
90
---- addresses for memory data
91
constant addr_hashM  : STD_LOGIC_VECTOR(3 downto 0) := "0000";
92
constant addr_c1     : STD_LOGIC_VECTOR(3 downto 0) := "0001";
93
constant addr_N      : STD_LOGIC_VECTOR(3 downto 0) := "0010";
94
constant addr_E      : STD_LOGIC_VECTOR(3 downto 0) := "0011";
95
constant addr_d2     : STD_LOGIC_VECTOR(3 downto 0) := "0100";
96
constant addr_c2     : STD_LOGIC_VECTOR(3 downto 0) := "0101";
97
constant addr_c      : STD_LOGIC_VECTOR(3 downto 0) := "0110";
98
constant addr_hashMc : STD_LOGIC_VECTOR(3 downto 0) := "0111";
99
constant addr_cinv   : STD_LOGIC_VECTOR(3 downto 0) := "1000";
100
constant addr_one    : STD_LOGIC_VECTOR(3 downto 0) := "1001";
101
constant addr_unused : STD_LOGIC_VECTOR(3 downto 0) := "1101";
102
constant addr_z      : STD_LOGIC_VECTOR(3 downto 0) := "1110";
103
constant addr_p      : STD_LOGIC_VECTOR(3 downto 0) := "1111";
104
 
105
---- help_statuses_for_clarity
106
constant stat_all_data_readed : STD_LOGIC_VECTOR(5 downto 0) := "111111";
107
constant stat_clear_status    : STD_LOGIC_VECTOR(5 downto 0) := "000000";
108
 
109
end properties;
110
 
111
package body properties is
112
 
113
end properties;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.