aboutsummaryrefslogtreecommitdiff
path: root/src/rtl
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2019-01-11 15:11:46 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2019-01-11 15:11:46 +0100
commit3455dd0940bb09e2f08c7951d3b10f415251af80 (patch)
treee0615c909dce85f0c6c0b6f6bf5e73c075b635be /src/rtl
parentacd123d903253edbbe6cdeda5757f829ccbbfb3a (diff)
Fixed parameterized widths.
Diffstat (limited to 'src/rtl')
-rw-r--r--src/rtl/keywrap.v4
-rw-r--r--src/rtl/keywrap_core.v2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/rtl/keywrap.v b/src/rtl/keywrap.v
index 73a861c..d6a2b5e 100644
--- a/src/rtl/keywrap.v
+++ b/src/rtl/keywrap.v
@@ -262,7 +262,7 @@ module keywrap #(parameter ADDR_BITS = 13)
end
if (rlen_we)
- rlen_reg <= write_data[12 : 0];
+ rlen_reg <= write_data[(RLEN_BITS - 1) : 0];
if (a0_we)
a0_reg <= write_data;
@@ -374,7 +374,7 @@ module keywrap #(parameter ADDR_BITS = 13)
api_rd_delay_new = timeout_reg;
if (address == {{PAD{1'h0}}, ADDR_RLEN})
- api_rd_delay_new = {19'h0, rlen_reg};
+ api_rd_delay_new = {{(32 - RLEN_BITS){1'h0}}, rlen_reg};
if (address == {{PAD{1'h0}}, ADDR_A0})
api_rd_delay_new = core_a_result[63 : 32];
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index 3da4a19..adb3099 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -285,7 +285,7 @@ module keywrap_core #(parameter MEM_BITS = 11)
core_addr = block_ctr_reg;
core_we = 1'h0;
- xor_val = (rlen * iteration_ctr_reg) + {51'h0, (block_ctr_reg + 1'h1)};
+ xor_val = (rlen * iteration_ctr_reg) + {53'h0, (block_ctr_reg + 1'h1)};
if (encdec)
aes_block = {a_reg, core_rd_data};