hw/ip/aes/rtl/aes_sub_bytes.sv Cov: 100%
1: // Copyright lowRISC contributors.
2: // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3: // SPDX-License-Identifier: Apache-2.0
4: //
5: // AES SubBytes
6:
7: module aes_sub_bytes #(
8: parameter SBoxImpl = "lut"
9: ) (
10: input aes_pkg::mode_e mode_i,
11: input logic [3:0][3:0][7:0] data_i,
12: output logic [3:0][3:0][7:0] data_o
13: );
14:
15: // Individually substitute bytes
16: for (genvar j = 0; j < 4; j++) begin : gen_sbox_j
17: for (genvar i = 0; i < 4; i++) begin : gen_sbox_i
18: aes_sbox #(
19: .SBoxImpl ( SBoxImpl )
20: ) aes_sbox_ij (
21: .mode_i ( mode_i ),
22: .data_i ( data_i[i][j] ),
23: .data_o ( data_o[i][j] )
24: );
25: end
26: end
27:
28: endmodule
29: