diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-05-21 17:45:48 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-05-21 17:45:48 +0200 |
commit | b25a4d4dcc274d791cf7997eb88fcedc395c8a6f (patch) | |
tree | b1a837b35c0b2d11d985aeac7d38df2b8bb5bf7f /src/rtl | |
parent | 5bf8bd4db261c9823f0e80f6771f3e635c5cbb90 (diff) |
Removed the sword counter since it is not needed.
Diffstat (limited to 'src/rtl')
-rw-r--r-- | src/rtl/aes_encipher_block.v | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/src/rtl/aes_encipher_block.v b/src/rtl/aes_encipher_block.v index c1961bd..c3e672c 100644 --- a/src/rtl/aes_encipher_block.v +++ b/src/rtl/aes_encipher_block.v @@ -159,12 +159,6 @@ module aes_encipher_block( //---------------------------------------------------------------- // Registers including update variables and write enable. //---------------------------------------------------------------- - reg [1 : 0] sword_ctr_reg; - reg [1 : 0] sword_ctr_new; - reg sword_ctr_we; - reg sword_ctr_inc; - reg sword_ctr_rst; - reg [3 : 0] round_ctr_reg; reg [3 : 0] round_ctr_new; reg round_ctr_we; @@ -239,7 +233,6 @@ module aes_encipher_block( block_w1_reg <= 32'h0; block_w2_reg <= 32'h0; block_w3_reg <= 32'h0; - sword_ctr_reg <= 2'h0; round_ctr_reg <= 4'h0; ready_reg <= 1'b1; enc_ctrl_reg <= CTRL_IDLE; @@ -258,9 +251,6 @@ module aes_encipher_block( if (block_w3_we) block_w3_reg <= block_new[031 : 000]; - if (sword_ctr_we) - sword_ctr_reg <= sword_ctr_new; - if (round_ctr_we) round_ctr_reg <= round_ctr_new; @@ -347,29 +337,6 @@ module aes_encipher_block( //---------------------------------------------------------------- - // sword_ctr - // - // The subbytes word counter with reset and increase logic. - //---------------------------------------------------------------- - always @* - begin : sword_ctr - sword_ctr_new = 2'h0; - sword_ctr_we = 1'b0; - - if (sword_ctr_rst) - begin - sword_ctr_new = 2'h0; - sword_ctr_we = 1'b1; - end - else if (sword_ctr_inc) - begin - sword_ctr_new = sword_ctr_reg + 1'b1; - sword_ctr_we = 1'b1; - end - end // sword_ctr - - - //---------------------------------------------------------------- // round_ctr // // The round counter with reset and increase logic. @@ -402,13 +369,9 @@ module aes_encipher_block( reg [3 : 0] num_rounds; if (keylen == AES_256_BIT_KEY) - begin - num_rounds = AES256_ROUNDS; - end + num_rounds = AES256_ROUNDS; else - begin - num_rounds = AES128_ROUNDS; - end + num_rounds = AES128_ROUNDS; round_ctr_inc = 1'b0; round_ctr_rst = 1'b0; |