aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-07-05 13:23:10 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-07-05 13:23:10 +0200
commite7aa2b3d029e617f1461343770358e67f3febd32 (patch)
tree3b123751c90aeaa0f7d4c861af808e55eceb6574 /src
parent05805e7933df2dc4f19fe6a4fca9425fa27ab09b (diff)
Removed a few states and a few cycles.
Diffstat (limited to 'src')
-rw-r--r--src/rtl/keywrap_core.v33
1 files 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)