login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

The inverse Rijndael S-box used in the Advanced Encryption Standard (AES); inverse permutation of A354500.
2

%I #14 Aug 15 2022 23:32:47

%S 82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,

%T 130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,

%U 194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109

%N The inverse Rijndael S-box used in the Advanced Encryption Standard (AES); inverse permutation of A354500.

%H Jianing Song, <a href="/A354501/b354501.txt">Table of n, a(n) for n = 0..255</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Rijndael_S-box">Rijndael S-box</a>

%F a(n) = ivgenpoly((((x^6+x^3+x)*genpoly(n) + x^2 + 1) mod (x^8+1))^254 mod (x^8+x^4+x^3+x+1)), where ivgenpoly and genpoly are the notations introduced in A355891. Beware that all the operations are done in GF(2)[x].

%F To be more concretely, to obtain a(n):

%F - Write the binary expansion of n and view it as a polynomial p(x) in GF(2)[x]; (E.g., 103 = 1100111_2 => x^6 + x^5 + x^2 + x + 1)

%F - Compute q(x) = ((x^6+x^3+x)*p(x) + x^2 + 1) mod (x^8+1) in GF(2)[x]; (E.g., x^6 + x^5 + x^2 + x + 1 => x^5 + x^3 + 1)

%F - Compute r(x) = q(x)^254 mod (x^8+x^4+x^3+x+1) in GF(2)[x]; (E.g., x^5 + x^3 + 1 => x^3 + x)

%F - To get a(n), view r(x) as a number. (E.g., x^3 + x => 2^3 + 2 = 10)

%F This is the inverse to the process described in A354500.

%e The inverse Rijndael S-box written in hexadecimal:

%e +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F

%e 00 52 09 6A D5 30 36 A5 38 BF 40 A3 9E 81 F3 D7 FB

%e 10 7C E3 39 82 9B 2F FF 87 34 8E 43 44 C4 DE E9 CB

%e 20 54 7B 94 32 A6 C2 23 3D EE 4C 95 0B 42 FA C3 4E

%e 30 08 2E A1 66 28 D9 24 B2 76 5B A2 49 6D 8B D1 25

%e 40 72 F8 F6 64 86 68 98 16 D4 A4 5C CC 5D 65 B6 92

%e 50 6C 70 48 50 FD ED B9 DA 5E 15 46 57 A7 8D 9D 84

%e 60 90 D8 AB 00 8C BC D3 0A F7 E4 58 05 B8 B3 45 06

%e 70 D0 2C 1E 8F CA 3F 0F 02 C1 AF BD 03 01 13 8A 6B

%e 80 3A 91 11 41 4F 67 DC EA 97 F2 CF CE F0 B4 E6 73

%e 90 96 AC 74 22 E7 AD 35 85 E2 F9 37 E8 1C 75 DF 6E

%e A0 47 F1 1A 71 1D 29 C5 89 6F B7 62 0E AA 18 BE 1B

%e B0 FC 56 3E 4B C6 D2 79 20 9A DB C0 FE 78 CD 5A F4

%e C0 1F DD A8 33 88 07 C7 31 B1 12 10 59 27 80 EC 5F

%e D0 60 51 7F A9 19 B5 4A 0D 2D E5 7A 9F 93 C9 9C EF

%e E0 A0 E0 3B 4D AE 2A F5 B0 C8 EB BB 3C 83 53 99 61

%e F0 17 2B 04 7E BA 77 D6 26 E1 69 14 63 55 21 0C 7D

%e The inverse Rijndael S-box written in decimal:

%e +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15

%e 0 82 9 106 213 48 54 165 56 191 64 163 158 129 243 215 251

%e 16 124 227 57 130 155 47 255 135 52 142 67 68 196 222 233 203

%e 32 84 123 148 50 166 194 35 61 238 76 149 11 66 250 195 78

%e 48 8 46 161 102 40 217 36 178 118 91 162 73 109 139 209 37

%e 64 114 248 246 100 134 104 152 22 212 164 92 204 93 101 182 146

%e 80 108 112 72 80 253 237 185 218 94 21 70 87 167 141 157 132

%e 96 144 216 171 0 140 188 211 10 247 228 88 5 184 179 69 6

%e 112 208 44 30 143 202 63 15 2 193 175 189 3 1 19 138 107

%e 128 58 145 17 65 79 103 220 234 151 242 207 206 240 180 230 115

%e 144 150 172 116 34 231 173 53 133 226 249 55 232 28 117 223 110

%e 160 71 241 26 113 29 41 197 137 111 183 98 14 170 24 190 27

%e 176 252 86 62 75 198 210 121 32 154 219 192 254 120 205 90 244

%e 192 31 221 168 51 136 7 199 49 177 18 16 89 39 128 236 95

%e 208 96 81 127 169 25 181 74 13 45 229 122 159 147 201 156 239

%e 224 160 224 59 77 174 42 245 176 200 235 187 60 131 83 153 97

%e 240 23 43 4 126 186 119 214 38 225 105 20 99 85 33 12 125

%o (PARI) m(P) = Mod(P, 2);

%o A354501(n) = subst(lift(lift(Mod(lift(Mod(m(x^6+x^3+x)*Pol(binary(n))+m(x^2+1), m(x^8+1))), m(x^8+x^4+x^3+x+1))^254)), x, 2)

%Y Cf. A354500, A355891.

%K nonn,easy,fini,full

%O 0,1

%A _Jianing Song_, Aug 15 2022