From 8897cc255d61b1f3bcc8a6ab807d98215e02c8a3 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Thu, 21 Oct 2021 14:53:12 +0800 Subject: [PATCH] Updated SM4 with AESENCLAST (markdown) --- SM4-with-AESENCLAST.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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