[Cryptech-Commits] [core/sha1] 01/01: Adding a separate digiest update state.

git at cryptech.is git at cryptech.is
Fri Dec 5 10:37:41 UTC 2014


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

joachim at secworks.se pushed a commit to branch master
in repository core/sha1.

commit ba1e8373a70472e322aad228469404b71c5e50bb
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Fri Dec 5 11:36:28 2014 +0100

    Adding a separate digiest update state.
---
 src/rtl/sha1_core.v | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/rtl/sha1_core.v b/src/rtl/sha1_core.v
index 6c026da..22f8cc2 100644
--- a/src/rtl/sha1_core.v
+++ b/src/rtl/sha1_core.v
@@ -65,7 +65,8 @@ module sha1_core(
 
   parameter CTRL_IDLE   = 0;
   parameter CTRL_ROUNDS = 1;
-  parameter CTRL_DONE   = 2;
+  parameter CTRL_DIGEST = 2;
+  parameter CTRL_DONE   = 3;
 
 
   //----------------------------------------------------------------
@@ -413,15 +414,19 @@ module sha1_core(
 
             if (round_ctr_reg == SHA1_ROUNDS)
               begin
-                sha1_ctrl_new = CTRL_DONE;
+                sha1_ctrl_new = CTRL_DIGEST;
                 sha1_ctrl_we  = 1;
               end
           end
 
+        CTRL_DIGEST:
+          begin
+            digest_update = 1;
+            sha1_ctrl_new = CTRL_DONE;
+            sha1_ctrl_we  = 1;
 
         CTRL_DONE:
           begin
-            digest_update    = 1;
             digest_valid_new = 1;
             digest_valid_we  = 1;
             sha1_ctrl_new    = CTRL_IDLE;



More information about the Commits mailing list