diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2017-12-14 16:31:52 +0100 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2017-12-14 16:31:52 +0100 |
commit | 0361065e15bfa903aaee988b8757419a120735c6 (patch) | |
tree | 7e04dc94c18e195345e93bf950ac927695916c68 /src/rtl/aes_sbox.v | |
parent | 67cd02c98626fc526c9e5e1790e049177190eab8 (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_sbox.v')
-rw-r--r-- | src/rtl/aes_sbox.v | 19 |
1 files changed, 11 insertions, 8 deletions
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 //====================================================================== |