data/full_repos/permissive/523492216/verilog/mixcolumn.v
data/verilator_xmls/0e4913ad-3291-4885-b523-d16682008a8b.xml
function automatic [31:0] mixcol_single_encrypt;
    input [31:0] vec;
    reg [7:0] b0, b1, b2, b3;
    reg [7:0] c0, c1, c2, c3;
    begin
      b0 = vec[7:0];
      b1 = vec[15:8];
      b2 = vec[23:16];
      b3 = vec[31:24];

      c0 = mult(2'b10, b0) ^ mult(2'b11, b1) ^ b2 ^ b3;
      c1 = b0 ^ mult(2'b10, b1) ^ mult(2'b11, b2) ^ b3;
      c2 = b0 ^ b1 ^ mult(2'b10, b2) ^ mult(2'b11, b3);
      c3 = mult(2'b11, b0) ^ b1 ^ b2 ^ mult(2'b10, b3);

      mixcol_single_encrypt = {c3, c2, c1, c0};
    end
  endfunction
function automatic [31:0] mixcol_single_encrypt;

    input [31:0] vec;
    reg [7:0] b0, b1, b2, b3;
    reg [7:0] c0, c1, c2, c3;
    begin
      b0 = vec[7:0];
      b1 = vec[15:8];
      b2 = vec[23:16];
      b3 = vec[31:24];

      c0 = mult(2'b10, b0) ^ mult(2'b11, b1) ^ b2 ^ b3;
      c1 = b0 ^ mult(2'b10, b1) ^ mult(2'b11, b2) ^ b3;
      c2 = b0 ^ b1 ^ mult(2'b10, b2) ^ mult(2'b11, b3);
      c3 = mult(2'b11, b0) ^ b1 ^ b2 ^ mult(2'b10, b3);

      mixcol_single_encrypt = {c3, c2, c1, c0};
    end
  endfunction