aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/keywrap_core.v
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-09-25 14:35:35 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-09-25 14:35:35 +0200
commitd3e94a0efeec9b2cbac41eea9a57dc3eaf848b21 (patch)
tree5945f9de5a12ec5b608847e65d281ed38624a02b /src/rtl/keywrap_core.v
parent139b3e484d9d170c739498bc9de7ee8106af9c55 (diff)
Updated the keywrap API to support access to MKM status. Updated keywrap_core to support control of MKM access operations.
Diffstat (limited to 'src/rtl/keywrap_core.v')
-rw-r--r--src/rtl/keywrap_core.v52
1 files changed, 27 insertions, 25 deletions
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index 5a05b63..8688e31 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -54,6 +54,7 @@ module keywrap_core #(parameter MEM_BITS = 11)
input wire next,
input wire read,
input wire write,
+ input wire mkey_mstatus,
input wire encdec,
output wire ready,
@@ -63,8 +64,8 @@ module keywrap_core #(parameter MEM_BITS = 11)
input wire [255 : 0] key,
input wire keylen,
- output wire [255 : 0] read_key,
- output wire [31 : 0] mkm_status,
+ output wire [255 : 0] mkey,
+ output wire [31 : 0] mstatus,
input wire [63 : 0] a_init,
output wire [63 : 0] a_result,
@@ -81,21 +82,22 @@ module keywrap_core #(parameter MEM_BITS = 11)
//----------------------------------------------------------------
localparam MAX_ITERATIONS = 6 - 1;
- localparam CTRL_IDLE = 6'h0;
- localparam CTRL_INIT_WAIT = 6'h1;
- localparam CTRL_NEXT_WSTART = 6'h2;
- localparam CTRL_NEXT_USTART = 6'h3;
- localparam CTRL_NEXT_LOOP0 = 6'h4;
- localparam CTRL_NEXT_LOOP = 6'h5;
- localparam CTRL_NEXT_WAIT = 6'h6;
- localparam CTRL_NEXT_UPDATE = 6'h7;
- localparam CTRL_NEXT_WCHECK = 6'h8;
- localparam CTRL_NEXT_UCHECK = 6'h9;
- localparam CTRL_NEXT_FINALIZE = 6'ha;
- localparam CTRL_READ_START = 6'h10;
- localparam CTRL_READ_END = 6'h11;
- localparam CTRL_WRITE_START = 6'h18;
- localparam CTRL_WRITE_END = 6'h19;
+ localparam CTRL_IDLE = 6'h0;
+ localparam CTRL_INIT_WAIT = 6'h1;
+ localparam CTRL_NEXT_WSTART = 6'h2;
+ localparam CTRL_NEXT_USTART = 6'h3;
+ localparam CTRL_NEXT_LOOP0 = 6'h4;
+ localparam CTRL_NEXT_LOOP = 6'h5;
+ localparam CTRL_NEXT_WAIT = 6'h6;
+ localparam CTRL_NEXT_UPDATE = 6'h7;
+ localparam CTRL_NEXT_WCHECK = 6'h8;
+ localparam CTRL_NEXT_UCHECK = 6'h9;
+ localparam CTRL_NEXT_FINALIZE = 6'ha;
+
+ localparam CTRL_MKM_RD_START = 6'h10;
+ localparam CTRL_MKM_RD_END = 6'h11;
+ localparam CTRL_MKM_WR_START = 6'h18;
+ localparam CTRL_MKM_WR_END = 6'h19;
// API for mkm used by the core.
localparam MKM_ADDR_CTRL = 8'h08;
@@ -491,7 +493,7 @@ module keywrap_core #(parameter MEM_BITS = 11)
begin
ready_new = 1'h0;
ready_we = 1'h1;
- keywrap_core_ctrl_new = CTRL_READ_START;
+ keywrap_core_ctrl_new = CTRL_MKM_RD_START;
keywrap_core_ctrl_we = 1'h1;
end
@@ -499,7 +501,7 @@ module keywrap_core #(parameter MEM_BITS = 11)
begin
ready_new = 1'h0;
ready_we = 1'h1;
- keywrap_core_ctrl_new = CTRL_WRITE_START;
+ keywrap_core_ctrl_new = CTRL_MKM_WR_START;
keywrap_core_ctrl_we = 1'h1;
end
end
@@ -633,14 +635,14 @@ module keywrap_core #(parameter MEM_BITS = 11)
end
- CTRL_READ_START:
+ CTRL_MKM_RD_START:
begin
- keywrap_core_ctrl_new = CTRL_READ_END;
+ keywrap_core_ctrl_new = CTRL_MKM_RD_END;
keywrap_core_ctrl_we = 1'h1;
end
- CTRL_READ_END:
+ CTRL_MKM_RD_END:
begin
ready_new = 1'h1;
ready_we = 1'h1;
@@ -649,14 +651,14 @@ module keywrap_core #(parameter MEM_BITS = 11)
end
- CTRL_WRITE_START:
+ CTRL_MKM_WR_START:
begin
- keywrap_core_ctrl_new = CTRL_WRITE_END;
+ keywrap_core_ctrl_new = CTRL_MKM_WR_END;
keywrap_core_ctrl_we = 1'h1;
end
- CTRL_WRITE_END:
+ CTRL_MKM_WR_END:
begin
ready_new = 1'h1;
ready_we = 1'h1;