aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/sha1_core.v
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2014-12-05 11:36:28 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2014-12-05 11:36:28 +0100
commitba1e8373a70472e322aad228469404b71c5e50bb (patch)
tree86d96bd1447a1acde8dcc498311b35251f73e9f0 /src/rtl/sha1_core.v
parentd09b5ae4075e117ccf4d470050941fc2cd9da268 (diff)
Adding a separate digiest update state.
Diffstat (limited to 'src/rtl/sha1_core.v')
-rw-r--r--src/rtl/sha1_core.v11
1 files 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;