[Cryptech-Commits] [core/hash/sha512] branch clock_speed updated: Fixing reg update signals. Fixing names.

git at cryptech.is git at cryptech.is
Tue Apr 24 16:22:09 UTC 2018


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch clock_speed
in repository core/hash/sha512.

The following commit(s) were added to refs/heads/clock_speed by this push:
     new 535625a  Fixing reg update signals. Fixing names.
535625a is described below

commit 535625ac0d0cbf7b2d8831e023e2614ebee90ef0
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue Apr 24 18:21:02 2018 +0200

    Fixing reg update signals. Fixing names.
---
 src/rtl/sha512_core.v | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/rtl/sha512_core.v b/src/rtl/sha512_core.v
index 1b50a6f..43ece2b 100644
--- a/src/rtl/sha512_core.v
+++ b/src/rtl/sha512_core.v
@@ -82,8 +82,8 @@ module sha512_core(
   parameter SHA512_ROUNDS = 79;
 
   parameter CTRL_IDLE    = 0;
-  parameter CTRL_ROUNDS1 = 1;
-  parameter CTRL_ROUNDS2 = 2;
+  parameter CTRL_T1_T2   = 1;
+  parameter CTRL_ROUNDS  = 2;
   parameter CTRL_DONE    = 3;
 
 
@@ -110,10 +110,9 @@ module sha512_core(
 
   reg [63 : 0] t1_reg;
   reg [63 : 0] t1_new;
-  reg          t1_we;
   reg [63 : 0] t2_reg;
   reg [63 : 0] t2_new;
-  reg          t2_we;
+  reg          t1_t2_we;
 
   reg [63 : 0] H0_reg;
   reg [63 : 0] H0_new;
@@ -265,11 +264,11 @@ module sha512_core(
         end
       else
         begin
-          if (t1_we)
-            t1_reg <= t1_new;
-
-          if (t2_we)
-            t2_reg <= t2_new;
+          if (t1_t2_we)
+            begin
+              t1_reg <= t1_new;
+              t2_reg <= t2_new;
+            end
 
           if (a_h_we)
             begin
@@ -579,8 +578,7 @@ module sha512_core(
       state_init          = 0;
       state_update        = 0;
 
-      t1_we               = 1;
-      t2_we               = 1;
+      t1_t2_we            = 0;
 
       first_block         = 0;
       ready_flag          = 0;
@@ -616,7 +614,7 @@ module sha512_core(
                 round_ctr_rst       = 1;
                 digest_valid_new    = 0;
                 digest_valid_we     = 1;
-                sha512_ctrl_new     = CTRL_ROUNDS1;
+                sha512_ctrl_new     = CTRL_T1_T2;
                 sha512_ctrl_we      = 1;
               end
 
@@ -628,20 +626,21 @@ module sha512_core(
                 round_ctr_rst       = 1;
                 digest_valid_new    = 0;
                 digest_valid_we     = 1;
-                sha512_ctrl_new     = CTRL_ROUNDS1;
+                sha512_ctrl_new     = CTRL_T1_T2;
                 sha512_ctrl_we      = 1;
               end
           end
 
 
-        CTRL_ROUNDS1:
+        CTRL_T1_T2:
           begin
-            sha512_ctrl_new = CTRL_ROUNDS2;
+            t1_t2_we        = 1;
+            sha512_ctrl_new = CTRL_ROUNDS;
             sha512_ctrl_we  = 1;
           end
 
 
-        CTRL_ROUNDS2:
+        CTRL_ROUNDS:
           begin
             w_next        = 1;
             state_update  = 1;
@@ -664,7 +663,7 @@ module sha512_core(
                     w_init              = 1;
                     state_init          = 1;
                     round_ctr_rst       = 1;
-                    sha512_ctrl_new     = CTRL_ROUNDS1;
+                    sha512_ctrl_new     = CTRL_T1_T2;
                     sha512_ctrl_we      = 1;
                   end
                 else

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list