AES(Advanced Encryption Standard)


5.0 SubByte

The SubBytes phase of AES involves splitting the input into bytes and passing each through the Substitution Box or S-Box we created earlier in our last tutorial. Unlike DES, AES uses the same S-Box for all bytes. The AES S-Box implements inverse multiplication in Galois Field 28.

Here, each byte of our key is passed through the subbyte and a new output is being generated. This operation provides the non-linearity in the cipher. The S-box used is derived from the multiplicative inverse over GF(28), known to have good non-linearity properties.

watch the video below for demonstration in logism.







`timescale 1 ns/1 ps

   module SubBytes
   #
   (
    parameter DATA_W = 128,       //data width
    parameter NO_BYTES = DATA_W >> 3  //no of bytes = data width / 8
   )
   (
   input clk,                     //system clock
   input reset,                   //asynch active low reset
   input valid_in,                //input valid signal  
   input [DATA_W-1:0] data_in,    //input data
   output reg valid_out,          //output valid signal
   output [DATA_W-1:0] data_out   //output data
   )
   ;

   genvar i;
   generate                      //generating sbox roms 
   for (i=0; i< NO_BYTES ; i=i+1) begin : ROM
     SBox ROM(clk,reset,valid_in,data_in[(i*8)+7:(i*8)],data_out[(i*8)+7:(i*8)]);
   end
   endgenerate

   always@(posedge clk or negedge reset)   //valid out register
   if(!reset)begin
       valid_out <= 1'b0;
   end else begin
       valid_out <= valid_in;
     end
   endmodule
   





John Doe
2:19:32am On 2019.07.15
Can u provide us a full source code of this above AES explanation?.
John Doe
5:20:60am On 2019.06.22
To be honest, this is probably one of the best and easiest coding video I ve ever seen. Thank you!.
John Doe
6:50:20am On 2019.08.16
Thank you for sharing this, feel it s very usefully.
John Doe
0:53:46pm On 2019.07.17
I like your accent xD.