From 0361065e15bfa903aaee988b8757419a120735c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 14 Dec 2017 16:31:52 +0100 Subject: Synced the AES core rtl and testbench to github. The updates does not add or modify any functionality, but silence a lot of warnings, reduce code size. --- src/rtl/aes_inv_sbox.v | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/rtl/aes_inv_sbox.v') diff --git a/src/rtl/aes_inv_sbox.v b/src/rtl/aes_inv_sbox.v index 68642db..807f397 100644 --- a/src/rtl/aes_inv_sbox.v +++ b/src/rtl/aes_inv_sbox.v @@ -44,13 +44,22 @@ module aes_inv_sbox( //---------------------------------------------------------------- - // Wires. + // The inverse sbox array. //---------------------------------------------------------------- wire [7 : 0] inv_sbox [0 : 255]; //---------------------------------------------------------------- - // Concurrent assignments for ports. + // Four parallel muxes. + //---------------------------------------------------------------- + assign new_sword[31 : 24] = inv_sbox[sword[31 : 24]]; + assign new_sword[23 : 16] = inv_sbox[sword[23 : 16]]; + assign new_sword[15 : 08] = inv_sbox[sword[15 : 08]]; + assign new_sword[07 : 00] = inv_sbox[sword[07 : 00]]; + + + //---------------------------------------------------------------- + // Creating the contents of the array. //---------------------------------------------------------------- assign inv_sbox[8'h00] = 8'h52; assign inv_sbox[8'h01] = 8'h09; @@ -309,11 +318,6 @@ module aes_inv_sbox( assign inv_sbox[8'hfe] = 8'h0c; assign inv_sbox[8'hff] = 8'h7d; - assign new_sword[31 : 24] = inv_sbox[sword[31 : 24]]; - assign new_sword[23 : 16] = inv_sbox[sword[23 : 16]]; - assign new_sword[15 : 08] = inv_sbox[sword[15 : 08]]; - assign new_sword[07 : 00] = inv_sbox[sword[07 : 00]]; - endmodule // aes_inv_sbox //====================================================================== -- cgit v1.2.3