aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/aes_inv_sbox.v
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2017-12-14 16:31:52 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2017-12-14 16:31:52 +0100
commit0361065e15bfa903aaee988b8757419a120735c6 (patch)
tree7e04dc94c18e195345e93bf950ac927695916c68 /src/rtl/aes_inv_sbox.v
parent67cd02c98626fc526c9e5e1790e049177190eab8 (diff)
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.
Diffstat (limited to 'src/rtl/aes_inv_sbox.v')
-rw-r--r--src/rtl/aes_inv_sbox.v18
1 files changed, 11 insertions, 7 deletions
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
//======================================================================