Skip to content

Commit b1ac758

Browse files
Use const List<int> where possible to prevent accidental mutation.
1 parent 28c61be commit b1ac758

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/src/core/kiasu_bc.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const int gfModulus = 0x1b; // Irreducible polynomial: x^8 + x^4 + x^3 + x + 1.
1010
const int gfHighBit = 0x80; // Used for carry detection in GF multiplication.
1111

1212
/// AES S-box.
13-
final List<int> sbox = [
13+
const List<int> sbox = [
1414
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b,
1515
//
1616
0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
@@ -57,7 +57,7 @@ final List<int> sbox = [
5757
];
5858

5959
/// AES inverse S-box.
60-
final List<int> invSbox = [
60+
const List<int> invSbox = [
6161
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e,
6262
//
6363
0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
@@ -104,7 +104,7 @@ final List<int> invSbox = [
104104
];
105105

106106
/// AES round constants.
107-
final List<int> rcon = [
107+
const List<int> rcon = [
108108
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36,
109109
//
110110
];

0 commit comments

Comments
 (0)