Updated SM4 with AESENCLAST (markdown)

Sun Yimin 2023-10-10 16:39:53 +08:00
parent cb38028d95
commit ddf84187f2

@ -177,6 +177,11 @@ func sm4_box_aesenclast_intel(rk uint32, t0, t1, t2, t3, a1l, a1h, a2l, a2h __m1
``` ```
其实x = mm_shuffle_epi8(x, intelmaskSrows)在mm_aesenclast_si128之前调用结果也是一样的。 其实x = mm_shuffle_epi8(x, intelmaskSrows)在mm_aesenclast_si128之前调用结果也是一样的。
类似于:
```
{(M1, C1, M2, C2) | SM4-S(x) = A2(AES-S(A1(x)), A1(x) = M1*x + C1, A2(x) = M2*(x+0x63) + C2 = M2*x + M2*0x63 + C2}
```
## How to calculate lookup table from M, C? ## How to calculate lookup table from M, C?
$\{ M\times i + C \mid i \in [0,255] \}$ $\{ M\times i + C \mid i \in [0,255] \}$