[Cryptech-Commits] [user/js/keywrap] 02/03: Removed a few states and a few cycles.

git at cryptech.is git at cryptech.is
Thu Jul 5 11:24:03 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 user/js/keywrap.

commit e7aa2b3d029e617f1461343770358e67f3febd32
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Thu Jul 5 13:23:10 2018 +0200

    Removed a few states and a few cycles.
---
 src/rtl/keywrap_core.v | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index 0788024..28e8f74 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -72,17 +72,13 @@ module keywrap_core (
   localparam OUTER_LOOP_MAX = 6 - 1;
 
   localparam CTRL_IDLE          = 4'h0;
-
-  localparam CTRL_INIT_START    = 4'h1;
-  localparam CTRL_INIT_WAIT     = 4'h2;
-
-  localparam CTRL_NEXT_START    = 4'h4;
-  localparam CTRL_NEXT_LOOP     = 4'h5;
-  localparam CTRL_NEXT_WAIT0    = 4'h6;
-  localparam CTRL_NEXT_WAIT     = 4'h7;
-  localparam CTRL_NEXT_UPDATE   = 4'h9;
-  localparam CTRL_NEXT_CHECK    = 4'ha;
-  localparam CTRL_NEXT_FINALIZE = 4'hb;
+  localparam CTRL_INIT_WAIT     = 4'h1;
+  localparam CTRL_NEXT_LOOP     = 4'h2;
+  localparam CTRL_NEXT_WAIT0    = 4'h3;
+  localparam CTRL_NEXT_WAIT     = 4'h4;
+  localparam CTRL_NEXT_UPDATE   = 4'h5;
+  localparam CTRL_NEXT_CHECK    = 4'h6;
+  localparam CTRL_NEXT_FINALIZE = 4'h7;
 
 
   //----------------------------------------------------------------
@@ -339,36 +335,29 @@ module keywrap_core (
           begin
             if (init)
               begin
+                aes_init              = 1'h1;
                 ready_new             = 1'h0;
                 ready_we              = 1'h1;
                 valid_new             = 1'h0;
                 valid_we              = 1'h1;
-                keywrap_core_ctrl_new = CTRL_INIT_START;
+                keywrap_core_ctrl_new = CTRL_INIT_WAIT;
                 keywrap_core_ctrl_we  = 1'h1;
               end
 
             if (next)
               begin
+                block_ctr_rst         = 1'h1;
+                iteration_ctr_rst     = 1'h1;
                 ready_new             = 1'h0;
                 ready_we              = 1'h1;
                 valid_new             = 1'h0;
                 valid_we              = 1'h1;
                 init_a                = 1'h1;
-                block_ctr_rst         = 1'h1;
-                iteration_ctr_rst     = 1'h1;
                 keywrap_core_ctrl_new = CTRL_NEXT_LOOP;
                 keywrap_core_ctrl_we  = 1'h1;
               end
           end
 
-
-        CTRL_INIT_START:
-          begin
-            aes_init              = 1'h1;
-            keywrap_core_ctrl_new = CTRL_INIT_WAIT;
-            keywrap_core_ctrl_we  = 1'h1;
-          end
-
         CTRL_INIT_WAIT:
           begin
             if (aes_ready)



More information about the Commits mailing list