AES(Advanced Encryption Standard)


3.0 AddRoundKey

This is the first step of AES algorithm, and this is simply XOR operation. We have 128-bit length plaintext and 128-bit length key so XOR operate bit by bit. watch the video below for demonstration in logism.







`timescale 1 ns/1 ps

module AddRoundKey
#
(
parameter DATA_W = 128            //data width
)
(
input clk,                        //system clock
input reset,                      //asynch active low reset
input data_valid_in,              //data valid signal
input key_valid_in,               //key valid signal  
input [DATA_W-1:0] data_in,       //input data
input [DATA_W-1:0] round_key,     //input round key
output reg valid_out,             //output valid signal
output reg [DATA_W-1:0] data_out  //output data
)
;

always@(posedge clk or negedge reset)
if(!reset)begin
    data_out <= 'b0;
    valid_out <= 1'b0;
end
else begin
    if(data_valid_in && key_valid_in) begin
    data_out <=  data_in ^ round_key;      //xoring data and round key       
    end
    valid_out <=  data_valid_in & key_valid_in;
end
endmodule





John Doe
5:13:33am On 2019.01.6
Like every other video, no info about key sizes other than 128, i.e. which 128 bits to take for XORing with keys of size 192 and 256 .
John Doe
7:23:47pm On 2019.04.26
I like how you explain this AddRoundKey thing and it just comes out to be an XOR operation :D.
John Doe
10:33:59pm On 2019.04.5
Utterly fantastic video(s)! It s so rare to find something this well done by a native english speaker!.
John Doe
10:47:25am On 2019.03.5
"In case you were doing AES by hand, which you would never do." Me: god I hate my professor for making me do it by hand.
John Doe
0:34:53am On 2019.02.16
Thank you for making me understand this so clearly..
John Doe
1:21:6pm On 2019.09.9
Can u provide us a full source code of this above AES explanation?.
John Doe
08:35:29pm On 2022.04.01
Otbwqz [url=https://oscialipop.com]cialis online pharmacy[/url] Enmome cialis with dapoxetine review <a href=https://oscialipop.com>cialis order online</a> Kozloq Cod Legally Pyridium Express Delivery Overseas Keyxxo https://oscialipop.com - o.
John Doe
06:49:24pm On 2022.11.05
<a href=http://bestcialis20mg.com/>generic cialis no prescription</a> Standard procedures were used for IHC and immunofluorescence IF.
John Doe
11:56:16pm On 2023.11.04
Your mouth may get dry <a href=http://cial.buzz>purchase cialis online cheap</a> Study Links F12 and STC2 Genes to Breast Cancer Survival.