[Cryptech-Commits] [core/util/keywrap] 93/95: Added non-zero default timeout value in core. This fixes the keywrap problems by not automatically reset the key in the API. Enabled all testcases and disabled excessive debug outputs.
git at cryptech.is
git at cryptech.is
Wed Mar 25 17:19:32 UTC 2020
This is an automated email from the git hooks/post-receive script.
paul at psgd.org pushed a commit to branch master
in repository core/util/keywrap.
commit f7c9cd18767f30259a285c3fd20a0905bea2b2d4
Author: Joachim Strömbergson <joachim at assured.se>
AuthorDate: Thu Jan 17 13:02:13 2019 +0100
Added non-zero default timeout value in core. This fixes the keywrap problems by not automatically reset the key in the API. Enabled all testcases and disabled excessive debug outputs.
---
src/rtl/keywrap_core.v | 4 +++-
src/tb/tb_keywrap.v | 28 ++++++++++++++--------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index b084363..0354475 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -91,6 +91,8 @@ module keywrap_core #(parameter MEM_BITS = 11)
localparam CTRL_NEXT_FINALIZE = 4'ha;
localparam CTRL_ZERO_WAIT = 4'hb;
+ localparam DEFAULT_TIMEOUT = 32'h0400_0000;
+
//----------------------------------------------------------------
// Registers and memories including control signals.
@@ -222,7 +224,7 @@ module keywrap_core #(parameter MEM_BITS = 11)
key_loaded_reg <= 1'h0;
block_ctr_reg <= {(MEM_BITS - 1){1'h0}};
iteration_ctr_reg <= 3'h0;
- key_timeout_ctr_reg <= 32'h0;
+ key_timeout_ctr_reg <= DEFAULT_TIMEOUT;
keywrap_core_ctrl_reg <= CTRL_IDLE;
end
diff --git a/src/tb/tb_keywrap.v b/src/tb/tb_keywrap.v
index c900b2a..b232ab3 100644
--- a/src/tb/tb_keywrap.v
+++ b/src/tb/tb_keywrap.v
@@ -39,7 +39,7 @@
module tb_keywrap();
- parameter DEBUG = 1;
+ parameter DEBUG = 0;
parameter DUMP_TOP = 1;
parameter DUMP_CORE = 1;
parameter DUMP_TIMEOUT = 1;
@@ -299,17 +299,17 @@ module tb_keywrap();
$display("keywrap_core_ctrl_reg = 0x%0x", dut.core.keywrap_core_ctrl_reg);
$display("keywrap_core_ctrl_new = 0x%0x", dut.core.keywrap_core_ctrl_new);
$display("keywrap_core_ctrl_we = 0x%0x", dut.core.keywrap_core_ctrl_we);
+ $display("");
end
if (DUMP_TIMEOUT)
begin
- $display("timeout signals:");
-
+ $display("timeout state:");
$display("api_timeout_reg = 0x%04x api_timeout_we = 0x%x", dut.timeout_reg, dut.timeout_we);
- $display("timeout = 0x%04x ping = 0x%x zeroise = 0x%x loaded = 0x%x",
- dut.core.timeout, dut.core.ping, dut.core.zeroise, dut.core.loaded);
- $display("key_timeout_ctr_reg = 0x%04x key_timeout_ctr_new = 0x%04x",
- dut.core.key_timeout_ctr_reg, dut.core.key_timeout_ctr_new);
+ $display("timeout_delay = 0x%04x timeout = 0x%x ping = 0x%x zeroise = 0x%x loaded = 0x%x",
+ dut.core.timeout_delay, dut.core.timeout, dut.core.ping, dut.core.zeroise, dut.core.loaded);
+ $display("key_timeout_ctr_reg = 0x%04x key_timeout_ctr_new = 0x%04x key_timeout_ctr_we = 0x%x",
+ dut.core.key_timeout_ctr_reg, dut.core.key_timeout_ctr_new, dut.core.key_timeout_ctr_we);
$display("key_timeout = 0x%x key_timeout_ctr_we = 0x%x key_timeout_ctr_set = 0x%x key_timeout_ctr_dec = 0x%x",
dut.core.key_timeout, dut.core.key_timeout_ctr_we, dut.core.key_timeout_ctr_set, dut.core.key_timeout_ctr_dec);
@@ -1531,15 +1531,15 @@ module tb_keywrap();
test_core_access();
test_kwp_ae_128_1();
-// test_kwp_ad_128_1();
-// test_kwp_ae_128_2();
-// test_kwp_ad_128_2();
-// test_big_wrap_256();
+ test_kwp_ad_128_1();
+ test_kwp_ae_128_2();
+ test_kwp_ad_128_2();
+ test_big_wrap_256();
reset_dut();
-// test_zeroise1();
-// test_zeroise2();
-// test_zeroise3();
+ test_zeroise1();
+ test_zeroise2();
+ test_zeroise3();
display_test_results();
More information about the Commits
mailing list