[Cryptech-Commits] [core/hash/sha1] branch master updated: Restricted write access for control bits to when the core is ready.

git at cryptech.is git at cryptech.is
Wed Oct 3 09:28:29 UTC 2018


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/hash/sha1.

The following commit(s) were added to refs/heads/master by this push:
     new 9daf474  Restricted write access for control bits to when the core is ready.
9daf474 is described below

commit 9daf474ac53397fbe8c427493f619b89917fc8fa
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Wed Oct 3 11:28:18 2018 +0200

    Restricted write access for control bits to when the core is ready.
---
 src/rtl/sha1.v | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/rtl/sha1.v b/src/rtl/sha1.v
index 9a112b0..c1fd8ec 100644
--- a/src/rtl/sha1.v
+++ b/src/rtl/sha1.v
@@ -195,13 +195,16 @@ module sha1(
         begin
           if (we)
             begin
-              if ((address >= ADDR_BLOCK0) && (address <= ADDR_BLOCK15))
-                block_we = 1;
-
-              if (address == ADDR_CTRL)
+              if (core_ready)
                 begin
-                  init_new = write_data[CTRL_INIT_BIT];
-                  next_new = write_data[CTRL_NEXT_BIT];
+                  if ((address >= ADDR_BLOCK0) && (address <= ADDR_BLOCK15))
+                    block_we = 1;
+
+                  if (address == ADDR_CTRL)
+                    begin
+                      init_new = write_data[CTRL_INIT_BIT];
+                      next_new = write_data[CTRL_NEXT_BIT];
+                    end
                 end
             end // if (write_read)
           else
@@ -210,7 +213,8 @@ module sha1(
                 tmp_read_data = block_reg[address[3 : 0]];
 
               if ((address >= ADDR_DIGEST0) && (address <= ADDR_DIGEST4))
-                tmp_read_data = digest_reg[(4 - (address - ADDR_DIGEST0)) * 32 +: 32];
+                if (core_ready)
+                  tmp_read_data = digest_reg[(4 - (address - ADDR_DIGEST0)) * 32 +: 32];
 
               case (address)
                 // Read operations.

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


More information about the Commits mailing list