From b25a4d4dcc274d791cf7997eb88fcedc395c8a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Mon, 21 May 2018 17:45:48 +0200 Subject: Removed the sword counter since it is not needed. --- src/rtl/aes_encipher_block.v | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'src/rtl') 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; @@ -346,29 +336,6 @@ module aes_encipher_block( end // round_logic - //---------------------------------------------------------------- - // 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 // @@ -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; -- cgit v1.2.3