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_sbox.v | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/rtl/aes_sbox.v') diff --git a/src/rtl/aes_sbox.v b/src/rtl/aes_sbox.v index 84ff6a9..09ba129 100644 --- a/src/rtl/aes_sbox.v +++ b/src/rtl/aes_sbox.v @@ -44,13 +44,22 @@ module aes_sbox( //---------------------------------------------------------------- - // Wires. + // The sbox array. //---------------------------------------------------------------- wire [7 : 0] sbox [0 : 255]; //---------------------------------------------------------------- - // Concurrent assignments for ports. + // Four parallel muxes. + //---------------------------------------------------------------- + assign new_sboxw[31 : 24] = sbox[sboxw[31 : 24]]; + assign new_sboxw[23 : 16] = sbox[sboxw[23 : 16]]; + assign new_sboxw[15 : 08] = sbox[sboxw[15 : 08]]; + assign new_sboxw[07 : 00] = sbox[sboxw[07 : 00]]; + + + //---------------------------------------------------------------- + // Creating the sbox array contents. //---------------------------------------------------------------- assign sbox[8'h00] = 8'h63; assign sbox[8'h01] = 8'h7c; @@ -309,12 +318,6 @@ module aes_sbox( assign sbox[8'hfe] = 8'hbb; assign sbox[8'hff] = 8'h16; - - assign new_sboxw[31 : 24] = sbox[sboxw[31 : 24]]; - assign new_sboxw[23 : 16] = sbox[sboxw[23 : 16]]; - assign new_sboxw[15 : 08] = sbox[sboxw[15 : 08]]; - assign new_sboxw[07 : 00] = sbox[sboxw[07 : 00]]; - endmodule // aes_sbox //====================================================================== -- cgit v1.2.3