From ba1e8373a70472e322aad228469404b71c5e50bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Fri, 5 Dec 2014 11:36:28 +0100 Subject: Adding a separate digiest update state. --- src/rtl/sha1_core.v | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/rtl/sha1_core.v') 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; -- cgit v1.2.3