diff options
-rw-r--r-- | src/rtl/keywrap.v | 4 | ||||
-rw-r--r-- | src/rtl/keywrap_core.v | 2 |
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}; |