slight tweak of names

This commit is contained in:
James E. Stine 2024-02-22 12:27:09 -06:00
parent 171da97fe3
commit c8468e99c0
10 changed files with 38 additions and 48 deletions

View File

@ -49,12 +49,11 @@ module aes32dsi(input logic [1:0] bs,
aes_inv_sbox inv_sbox(.in(sbox_in), .out(sbox_out)); aes_inv_sbox inv_sbox(.in(sbox_in), .out(sbox_out));
// Pad output of inverse substitution box // Pad output of inverse substitution box
assign so = {24'h000000,sbox_out}; assign so = {24'h0, sbox_out};
// Rotate the substitution box output left by shamt (bs * 8) // Rotate the substitution box output left by shamt (bs * 8)
rotate_left rol32(.input_data(so), .shamt(shamt), .rot_data(so_rotate)); rotate_left rol32(.input_data(so), .shamt(shamt), .rot_data(so_rotate));
// Set result to "X(rs1)[31..0] ^ rol32(so, unsigned(shamt));" // Set result to "X(rs1)[31..0] ^ rol32(so, unsigned(shamt));"
assign data_out = rs1 ^ so_rotate; assign data_out = rs1 ^ so_rotate;
endmodule endmodule

View File

@ -50,7 +50,7 @@ module aes32dsmi(input logic [1:0] bs,
aes_inv_sbox inv_sbox(.in(sbox_in), .out(sbox_out)); aes_inv_sbox inv_sbox(.in(sbox_in), .out(sbox_out));
// Pad output of inverse substitution box // Pad output of inverse substitution box
assign so = {24'h000000,sbox_out}; assign so = {24'h0, sbox_out};
// Run so through the mixword AES function // Run so through the mixword AES function
inv_mixword mix(.word(so), .mixed_word(mixed)); inv_mixword mix(.word(so), .mixed_word(mixed));
@ -60,5 +60,4 @@ module aes32dsmi(input logic [1:0] bs,
// Set result to "X(rs1)[31..0] ^ rol32(so, unsigned(shamt));" // Set result to "X(rs1)[31..0] ^ rol32(so, unsigned(shamt));"
assign data_out = rs1 ^ mixed_rotate; assign data_out = rs1 ^ mixed_rotate;
endmodule endmodule

View File

@ -51,12 +51,11 @@ module aes32esi(input logic [1:0] bs,
aes_sbox subbox(.in(sbox_in), .out(sbox_out)); aes_sbox subbox(.in(sbox_in), .out(sbox_out));
// Pad sbox output // Pad sbox output
assign so = {24'h000000,sbox_out}; assign so = {24'h0, sbox_out};
// Rotate so left by shamt // Rotate so left by shamt
rotate_left rol32(.input_data(so), .shamt(shamt), .rot_data(so_rotate)); rotate_left rol32(.input_data(so), .shamt(shamt), .rot_data(so_rotate));
// Set result X(rs1)[31..0] ^ rol32(so, unsigned(shamt)); // Set result X(rs1)[31..0] ^ rol32(so, unsigned(shamt));
assign data_out = rs1 ^ so_rotate; assign data_out = rs1 ^ so_rotate;
endmodule endmodule

View File

@ -52,7 +52,7 @@ module aes32esmi(input logic [1:0] bs,
aes_sbox sbox(.in(sbox_in), .out(sbox_out)); aes_sbox sbox(.in(sbox_in), .out(sbox_out));
// Pad sbox output // Pad sbox output
assign so = {24'h000000,sbox_out}; assign so = {24'h0, sbox_out};
// Mix Word using aes_mixword component // Mix Word using aes_mixword component
mixword mwd(.word(so), .mixed_word(mixed)); mixword mwd(.word(so), .mixed_word(mixed));
@ -62,5 +62,4 @@ module aes32esmi(input logic [1:0] bs,
// Set result X(rs1)[31..0] ^ rol32(mixed, unsigned(shamt)); // Set result X(rs1)[31..0] ^ rol32(mixed, unsigned(shamt));
assign data_out = rs1 ^ mixed_rotate; assign data_out = rs1 ^ mixed_rotate;
endmodule endmodule

View File

@ -43,5 +43,4 @@ module aes64ds(input logic [63:0] rs1,
// Concatenate the two substitution outputs to get result // Concatenate the two substitution outputs to get result
assign data_out = {sbox_out_1, sbox_out_0}; assign data_out = {sbox_out_1, sbox_out_0};
endmodule endmodule

View File

@ -49,5 +49,4 @@ module aes64dsm(input logic [63:0] rs1,
// Concatenate mixed words for output // Concatenate mixed words for output
assign data_out = {mixcol_out_1, mixcol_out_0}; assign data_out = {mixcol_out_1, mixcol_out_0};
endmodule endmodule

View File

@ -38,5 +38,4 @@ module aes64es(input logic [63:0] rs1,
// Apply substitution box to 2 lower words // Apply substitution box to 2 lower words
aes_sbox_word sbox_0(.in(shiftRow_out[31:0]), .out(data_out[31:0])); aes_sbox_word sbox_0(.in(shiftRow_out[31:0]), .out(data_out[31:0]));
aes_sbox_word sbox_1(.in(shiftRow_out[63:32]), .out(data_out[63:32])); aes_sbox_word sbox_1(.in(shiftRow_out[63:32]), .out(data_out[63:32]));
endmodule endmodule

View File

@ -43,5 +43,4 @@ module aes64esm(input logic [63:0] rs1,
// Apply mix columns operations // Apply mix columns operations
mixword mw0(.word(sbox_out[31:0]), .mixed_word(data_out[31:0])); mixword mw0(.word(sbox_out[31:0]), .mixed_word(data_out[31:0]));
mixword mw1(.word(sbox_out[63:32]), .mixed_word(data_out[63:32])); mixword mw1(.word(sbox_out[63:32]), .mixed_word(data_out[63:32]));
endmodule endmodule

View File

@ -30,5 +30,4 @@ module aes64im(input logic [63:0] rs1,
inv_mixword inv_mw_0(.word(rs1[31:0]), .mixed_word(data_out[31:0])); inv_mixword inv_mw_0(.word(rs1[31:0]), .mixed_word(data_out[31:0]));
inv_mixword inv_mw_1(.word(rs1[63:32]), .mixed_word(data_out[63:32])); inv_mixword inv_mw_1(.word(rs1[63:32]), .mixed_word(data_out[63:32]));
endmodule endmodule

View File

@ -36,5 +36,4 @@ module aes64ks2(input logic [63:0] rs2,
assign w0 = rs1[63:32] ^ rs2[31:0]; assign w0 = rs1[63:32] ^ rs2[31:0];
assign w1 = rs1[63:32] ^ rs2[31:0] ^ rs2[63:32]; assign w1 = rs1[63:32] ^ rs2[31:0] ^ rs2[63:32];
assign rd = {w1, w0}; assign rd = {w1, w0};
endmodule endmodule