Skip to content

Commit

Permalink
Fix aes_shift_rows_fwd and aes_shift_rows_inv functions from latest v…
Browse files Browse the repository at this point in the history
…ector spec.
  • Loading branch information
mlawson-tt committed Jun 30, 2023
1 parent 5c12d94 commit 9d851a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions model/riscv_types_kext.sail
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ function aes_shift_rows_fwd(x) = {
let ic2 : bits(32) = aes_get_column(x, 2);
let ic1 : bits(32) = aes_get_column(x, 1);
let ic0 : bits(32) = aes_get_column(x, 0);
let oc0 : bits(32) = ic0[31..24] @ ic1[23..16] @ ic2[15.. 8] @ ic3[ 7.. 0];
let oc1 : bits(32) = ic1[31..24] @ ic2[23..16] @ ic3[15.. 8] @ ic0[ 7.. 0];
let oc2 : bits(32) = ic2[31..24] @ ic3[23..16] @ ic0[15.. 8] @ ic1[ 7.. 0];
let oc3 : bits(32) = ic3[31..24] @ ic0[23..16] @ ic1[15.. 8] @ ic2[ 7.. 0];
let oc0 : bits(32) = ic3[31..24] @ ic2[23..16] @ ic1[15.. 8] @ ic0[ 7.. 0];
let oc1 : bits(32) = ic0[31..24] @ ic3[23..16] @ ic2[15.. 8] @ ic1[ 7.. 0];
let oc2 : bits(32) = ic1[31..24] @ ic0[23..16] @ ic3[15.. 8] @ ic2[ 7.. 0];
let oc3 : bits(32) = ic2[31..24] @ ic1[23..16] @ ic0[15.. 8] @ ic3[ 7.. 0];
(oc3 @ oc2 @ oc1 @ oc0) /* Return value */
}

Expand All @@ -368,10 +368,10 @@ function aes_shift_rows_inv(x) = {
let ic2 : bits(32) = aes_get_column(x, 2);
let ic1 : bits(32) = aes_get_column(x, 1);
let ic0 : bits(32) = aes_get_column(x, 0);
let oc0 : bits(32) = ic0[31..24] @ ic3[23..16] @ ic2[15.. 8] @ ic1[ 7.. 0];
let oc1 : bits(32) = ic1[31..24] @ ic0[23..16] @ ic3[15.. 8] @ ic2[ 7.. 0];
let oc2 : bits(32) = ic2[31..24] @ ic1[23..16] @ ic0[15.. 8] @ ic3[ 7.. 0];
let oc3 : bits(32) = ic3[31..24] @ ic2[23..16] @ ic1[15.. 8] @ ic0[ 7.. 0];
let oc0 : bits(32) = ic1[31..24] @ ic2[23..16] @ ic3[15.. 8] @ ic0[ 7.. 0];
let oc1 : bits(32) = ic2[31..24] @ ic3[23..16] @ ic0[15.. 8] @ ic1[ 7.. 0];
let oc2 : bits(32) = ic3[31..24] @ ic0[23..16] @ ic1[15.. 8] @ ic2[ 7.. 0];
let oc3 : bits(32) = ic0[31..24] @ ic1[23..16] @ ic2[15.. 8] @ ic3[ 7.. 0];
(oc3 @ oc2 @ oc1 @ oc0) /* Return value */
}

Expand Down

0 comments on commit 9d851a6

Please sign in to comment.