diff --git a/SM4-with-AESENCLAST.md b/SM4-with-AESENCLAST.md index 0456935..ed013db 100644 --- a/SM4-with-AESENCLAST.md +++ b/SM4-with-AESENCLAST.md @@ -1,3 +1,14 @@ This is the pure golang code to study SM4 implementation with AESENCLAST instruction. -[sm4 with AESENCLAST](https://gist.github.com/emmansun/ae4677d71c75ff8407d5f5b3a884f5d2) \ No newline at end of file +[sm4 with AESENCLAST](https://gist.github.com/emmansun/ae4677d71c75ff8407d5f5b3a884f5d2) + +We combine various linear operations into two affine transforms (one on +each side), A1 and A2. Here affine transform consists of a multiplication +with a 8x8 binary matrix M and addition of a 8-bit constant C. +``` +SM4-S(x) = A2(AES-S(A1(x)) +A1(x) = M1*x + C1 +A2(x) = M2*x + C2 +``` + +The combinations of (M1, C1, M2, C2) are not unique. \ No newline at end of file