SHA-2 Workbench
1.0
|
Unrolled architecture of the combinatorial part of the transformation round More...
Libraries | |
shacomps | |
Basic SHA components library. |
Signals | |
t1_tm4 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_1\) step function of the step \(t-4\). | |
t2_tm4 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_2\) step function of the step \(t-4\). | |
t1_tm3 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_1\) step function of the step \(t-3\). | |
t2_tm3 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_2\) step function of the step \(t-3\). | |
t1_tm2 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_1\) step function of the step \(t-2\). | |
t2_tm2 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_2\) step function of the step \(t-2\). | |
t1_tm1 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_1\) step function of the step \(t-1\). | |
t2_tm1 | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Output of the \(T_2\) step function of the step \(t-1\). | |
b | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(B\) at the step \(t\). | |
c | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(C\) at the step \(t\). | |
d | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(D\) at the step \(t\). | |
f | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(F\) at the step \(t\). | |
g | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(G\) at the step \(t\). | |
h | std_logic_vector ( WORD_WIDTH - 1 downto 0 ) := ( others = > ' 0 ' ) |
Value of the accumulator \(H\) at the step \(t\). |
Instantiations | |
t1_m4 | T1 <Entity T1> |
\(T_1\) step function of the step \(t-4\) | |
t2_m4 | T2 <Entity T2> |
\(T_2\) step function of the step \(t-4\) | |
t1_m3 | T1 <Entity T1> |
\(T_1\) step function of the step \(t-3\) | |
t2_m3 | T2 <Entity T2> |
\(T_2\) step function of the step \(t-3\) | |
t1_m2 | T1 <Entity T1> |
\(T_1\) step function of the step \(t-2\) | |
t2_m2 | T2 <Entity T2> |
\(T_2\) step function of the step \(t-2\) | |
t1_m1 | T1 <Entity T1> |
\(T_1\) step function of the step \(t-1\) | |
t2_m1 | T2 <Entity T2> |
\(T_2\) step function of the step \(t-1\) |
Aliases | |
K_tm4 | is K ( WORD_WIDTH - 1 downto 0 ) |
Constant \(K\) for the round \(t-4\). | |
K_tm3 | is K ( 2 * WORD_WIDTH - 1 downto WORD_WIDTH ) |
Constant \(K\) for the round \(t-3\). | |
K_tm2 | is K ( 3 * WORD_WIDTH - 1 downto 2 * WORD_WIDTH ) |
Constant \(K\) for the round \(t-2\). | |
K_tm1 | is K ( 4 * WORD_WIDTH - 1 downto 3 * WORD_WIDTH ) |
Constant \(K\) for the round \(t-1\). | |
W_tm4 | is W ( WORD_WIDTH - 1 downto 0 ) |
Expanded word for the round \(t-4\). | |
W_tm3 | is W ( 2 * WORD_WIDTH - 1 downto WORD_WIDTH ) |
Expanded word for the round \(t-3\). | |
W_tm2 | is W ( 3 * WORD_WIDTH - 1 downto 2 * WORD_WIDTH ) |
Expanded word for the round \(t-2\). | |
W_tm1 | is W ( 4 * WORD_WIDTH - 1 downto 3 * WORD_WIDTH ) |
Expanded word for the round \(t-1\). |
Unrolled architecture of the combinatorial part of the transformation round
This architecture performs 4 steps within a single clock cycle.
To perform the unrolling, start from a single step, which is given by:
\begin{align*} T^1_{t-1} & \propto E_{t-1}, F_{t-1}, G_{t-1}, H_{t-1}, K_{t-1}, W_{t-1} \\ T^2_{t-1} & \propto A_{t-1}, B_{t-1}, C_{t-1} \\ A_t & = T^1_{t-1} + T^2_{t-1} \\ B_t & = A_{t-1} \\ C_t & = B_{t-1} \\ D_t & = C_{t-1} \\ E_t & = D_{t-1} + T^1_{t-1} \\ F_t & = E_{t-1} \\ G_t & = F_{t-1} \\ H_t & = G_{t-1} \end{align*}
It is not necessary to specify exactly the structure of the step function, but only the positional dependency from the inputs.
Now it is needed to express outputs of the step \(t\) as functions of the inputs of the stage \(t-2\). The easy part is related to the step function of the step \(t-1\):
\begin{align*} T^1_{t-2} & \propto E_{t-2}, F_{t-2}, G_{t-2}, H_{t-2}, K_{t-2}, W_{t-2} \\ T^2_{t-2} & \propto A_{t-2}, B_{t-2}, C_{t-2} \end{align*}
Now, applying the step expression for the step \(t-1\) and substituting in the expression for the step \(t\) one can obtain:
\begin{align*} T^1_{t-1} & \propto D_{t-2} + T^1_{t-2}, E_{t-2}, F_{t-2}, G_{t-2}, K_{t-1}, W_{t-1} \\ T^2_{t-1} & \propto T^1_{t-2} + T^2_{t-2}, A_{t-2}, B_{t-2} \\ A_t & = T^1_{t-1} + T^2_{t-1} \\ B_t & = T^1_{t-2} + T^2_{t-2} \\ C_t & = A_{t-2} \\ D_t & = B_{t-2} \\ E_t & = C_{t-2} + T^1_{t-1} \\ F_t & = D_{t-2} + T^1_{t-2} \\ G_t & = E_{t-2} \\ H_t & = F_{t-2} \end{align*}
The same methodology can be applied to the step \(t-3\):
\begin{align*} T^1_{t-3} & \propto E_{t-3}, F_{t-3}, G_{t-3}, H_{t-3}, K_{t-3}, W_{t-3} \\ T^2_{t-3} & \propto A_{t-3}, B_{t-3}, C_{t-3} \\ T^1_{t-2} & \propto D_{t-3} + T^1_{t-3}, E_{t-3}, F_{t-3}, G_{t-3}, K_{t-2}, W_{t-2} \\ T^2_{t-2} & \propto T^1_{t-3} + T^2_{t-3}, A_{t-3}, B_{t-3} \\ T^1_{t-1} & \propto C_{t-3} + T^1_{t-2}, D_{t-3} + T^2_{t-3}, E_{t-3}, F_{t-3}, K_{t-1}, W_{t-1} \\ T^2_{t-1} & \propto T^1_{t-2} + T^2_{t-2}, T^1_{t-3} + T^2_{t-3}, A_{t-3} \\ A_t & = T^1_{t-1} + T^2_{t-1} \\ B_t & = T^1_{t-2} + T^2_{t-2} \\ C_t & = T^1_{t-3} + T^2_{t-3} \\ D_t & = A_{t-2} \\ E_t & = B_{t-3} + T^1_{t-1} \\ F_t & = C_{t-3} + T^1_{t-2} \\ G_t & = D_{t-3} + T^1_{t-3} \\ H_t & = E_{t-3} \end{align*}
Another application yields the outputs of the step \(t\) as functions of the inputs of the stage \(t-4\):
\begin{align*} T^1_{t-4} & \propto E_{t-4}, F_{t-4}, G_{t-4}, H_{t-4}, K_{t-4}, W_{t-4} \\ T^2_{t-4} & \propto A_{t-4}, B_{t-4}, C_{t-4} \\ T^1_{t-3} & \propto D_{t-4} + T^1_{t-4}, E_{t-4}, F_{t-4}, G_{t-4}, K_{t-3}, W_{t-3} \\ T^2_{t-3} & \propto T^1_{t-4} + T^2_{t-4}, A_{t-4}, B_{t-4} \\ T^1_{t-2} & \propto C_{t-4} + T^1_{t-3}, D_{t-4} + T^1_{t-4}, E_{t-4}, F_{t-4}, K_{t-2}, W_{t-2} \\ T^2_{t-2} & \propto T^1_{t-3} + T^2_{t-3}, T^1_{t-4} + T^2_{t-4}, A_{t-4} \\ T^1_{t-1} & \propto B_{t-4} + T^1_{t-2}, C_{t-4} + T^1_{t-3}, D_{t-4} + T^1_{t-4}, E_{t-4}, K_{t-1}, W_{t-1} \\ T^2_{t-1} & \propto T^1_{t-2} + T^2_{t-2}, T^1_{t-3} + T^2_{t-3}, T^1_{t-4} + T^2_{t-4} \\ A_t & = T^1_{t-1} + T^2_{t-1} \\ B_t & = T^1_{t-2} + T^2_{t-2} \\ C_t & = T^1_{t-3} + T^2_{t-3} \\ D_t & = T^1_{t-4} + T^2_{t-4} \\ E_t & = A_{t-4} + T^1_{t-1} \\ F_t & = B_{t-4} + T^1_{t-2} \\ G_t & = C_{t-4} + T^1_{t-3} \\ H_t & = D_{t-4} + T^1_{t-4} \end{align*}
Assuming to employ internal signals for the compute outputs, this expression can be rewritten as follows:
\begin{align*} T^1_{t-4} & \propto E_{t-4}, F_{t-4}, G_{t-4}, H_{t-4}, K_{t-4}, W_{t-4} \\ T^2_{t-4} & \propto A_{t-4}, B_{t-4}, C_{t-4} \\ T^1_{t-3} & \propto H_t, E_{t-4}, F_{t-4}, G_{t-4}, K_{t-3}, W_{t-3} \\ T^2_{t-3} & \propto D_t, A_{t-4}, B_{t-4} \\ T^1_{t-2} & \propto G_t, H_t, E_{t-4}, F_{t-4}, K_{t-2}, W_{t-2} \\ T^2_{t-2} & \propto C_t, D_t, A_{t-4} \\ T^1_{t-1} & \propto F_t, G_t, H_t, E_{t-4}, K_{t-1}, W_{t-1} \\ T^2_{t-1} & \propto B_t, G_t, D_t \\ A_t & = T^1_{t-1} + T^2_{t-1} \\ B_t & = T^1_{t-2} + T^2_{t-2} \\ C_t & = T^1_{t-3} + T^2_{t-3} \\ D_t & = T^1_{t-4} + T^2_{t-4} \\ E_t & = A_{t-4} + T^1_{t-1} \\ F_t & = B_{t-4} + T^1_{t-2} \\ G_t & = C_{t-4} + T^1_{t-3} \\ H_t & = D_{t-4} + T^1_{t-4} \end{align*}
|
Signal |
Value of the accumulator \(B\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Signal |
Value of the accumulator \(C\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Signal |
Value of the accumulator \(D\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Signal |
Value of the accumulator \(F\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Signal |
Value of the accumulator \(G\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Signal |
Value of the accumulator \(H\) at the step \(t\).
This value is computed early in the stage, and is employed later to compute other values
|
Alias |
Constant \(K\) for the round \(t-1\).
|
Alias |
Constant \(K\) for the round \(t-2\).
|
Alias |
Constant \(K\) for the round \(t-3\).
|
Alias |
Constant \(K\) for the round \(t-4\).
|
Library |
Basic SHA components library.
|
Instantiation |
\(T_1\) step function of the step \(t-1\)
|
Instantiation |
\(T_1\) step function of the step \(t-2\)
|
Instantiation |
\(T_1\) step function of the step \(t-3\)
|
Instantiation |
\(T_1\) step function of the step \(t-4\)
|
Signal |
Output of the \(T_1\) step function of the step \(t-1\).
|
Signal |
Output of the \(T_1\) step function of the step \(t-2\).
|
Signal |
Output of the \(T_1\) step function of the step \(t-3\).
|
Signal |
Output of the \(T_1\) step function of the step \(t-4\).
|
Instantiation |
\(T_2\) step function of the step \(t-1\)
|
Instantiation |
\(T_2\) step function of the step \(t-2\)
|
Instantiation |
\(T_2\) step function of the step \(t-3\)
|
Instantiation |
\(T_2\) step function of the step \(t-4\)
|
Signal |
Output of the \(T_2\) step function of the step \(t-1\).
|
Signal |
Output of the \(T_2\) step function of the step \(t-2\).
|
Signal |
Output of the \(T_2\) step function of the step \(t-3\).
|
Signal |
Output of the \(T_2\) step function of the step \(t-4\).
|
Alias |
Expanded word for the round \(t-1\).
|
Alias |
Expanded word for the round \(t-2\).
|
Alias |
Expanded word for the round \(t-3\).
|
Alias |
Expanded word for the round \(t-4\).