mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-10 19:16:18 +08:00
Updated SM4 with AESENCLAST (markdown)
parent
1188f05c4f
commit
25d407e0ea
@ -28,6 +28,8 @@ C1= 0x69
|
||||
M2= 0xfa ,0x64 ,0xb4 ,0x0a ,0x41 ,0xdd ,0x01 ,0xc1
|
||||
C2= 0x61
|
||||
|
||||
//https://github.com/intel/ipp-crypto/blob/develop/sources/ippcp/pcpsms4_l9cn.h
|
||||
//Intel也用了这组
|
||||
M1= 0x52 ,0xbc ,0x2d ,0x02 ,0x9e ,0x25 ,0xac ,0x34
|
||||
C1= 0x65
|
||||
M2= 0xcb ,0x9a ,0x0a ,0xb4 ,0xc7 ,0xac ,0x87 ,0x4e
|
||||
@ -179,7 +181,7 @@ func sm4_box_aesenclast_intel(rk uint32, t0, t1, t2, t3, a1l, a1h, a2l, a2h __m1
|
||||
|
||||
类似于:
|
||||
```
|
||||
{(M1, C1, M2, C2) | SM4-S(x) = A2(AES-S(A1(x)), A1(x) = M1*x + C1, A2(x) = M2*(x+0x63) + C2}
|
||||
{(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?
|
||||
|
Loading…
x
Reference in New Issue
Block a user