<s>
ShāngMì	O
4	O
(	O
SM4	B-Algorithm
,	O
商密4	O
)	O
(	O
formerly	O
SMS4	B-Algorithm
)	O
is	O
a	O
block	O
cipher	O
used	O
in	O
the	O
Chinese	O
National	O
Standard	O
for	O
Wireless	O
LAN	O
WAPI	O
(	O
WLAN	O
Authentication	O
and	O
Privacy	O
Infrastructure	O
)	O
and	O
also	O
used	O
with	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
.	O
</s>
<s>
SM4	B-Algorithm
was	O
a	O
cipher	O
proposed	O
to	O
for	O
the	O
IEEE	B-Protocol
802.11i	I-Protocol
standard	O
,	O
but	O
has	O
so	O
far	O
been	O
rejected	O
by	O
ISO	O
.	O
</s>
<s>
The	O
SM4	B-Algorithm
algorithm	I-Algorithm
was	O
drafted	O
by	O
Data	O
Assurance	O
&	O
Communication	O
Security	O
Center	O
,	O
CAS	O
,	O
and	O
Commercial	O
Cryptography	O
Testing	O
Center	O
,	O
National	O
Cryptography	O
Administration	O
.	O
</s>
<s>
The	O
SM4	B-Algorithm
cipher	O
has	O
a	O
key	O
size	O
and	O
a	O
block	O
size	O
of	O
128	O
bits	O
each	O
.	O
</s>
<s>
A	O
non-linear	O
key	B-Algorithm
schedule	I-Algorithm
is	O
used	O
to	O
produce	O
the	O
round	B-Algorithm
keys	I-Algorithm
and	O
the	O
decryption	O
uses	O
the	O
same	O
round	B-Algorithm
keys	I-Algorithm
as	O
for	O
encryption	O
,	O
except	O
that	O
they	O
are	O
in	O
reversed	O
order	O
.	O
</s>
<s>
The	O
round	B-Algorithm
keys	I-Algorithm
are	O
represented	O
by	O
,	O
where	O
each	O
is	O
a	O
word	O
.	O
</s>
<s>
and	O
are	O
words	O
,	O
used	O
to	O
generate	O
the	O
round	B-Algorithm
keys	I-Algorithm
.	O
</s>
<s>
As	O
with	O
AES	B-Algorithm
,	O
the	O
S-box	O
is	O
based	O
on	O
the	O
multiplicative	O
inverse	O
over	O
.	O
</s>
<s>
The	O
affine	O
transforms	O
and	O
polynomial	O
bases	O
are	O
different	O
from	O
that	O
of	O
AES	B-Algorithm
,	O
but	O
due	O
to	O
affine	O
isomorphism	O
it	O
can	O
be	O
calculated	O
efficiently	O
given	O
an	O
AES	B-Algorithm
Rijndael	B-Algorithm
S-box	O
.	O
</s>
<s>
On	O
March	O
21	O
,	O
2012	O
,	O
the	O
Chinese	O
government	O
published	O
the	O
industrial	O
standard	O
"	O
GM/T	O
0002-2012	O
SM4	B-Algorithm
Block	O
Cipher	O
Algorithm	O
"	O
,	O
officially	O
renaming	O
SMS4	B-Algorithm
to	O
SM4	B-Algorithm
.	O
</s>
<s>
A	O
description	O
of	O
SM4	B-Algorithm
in	O
English	O
is	O
available	O
as	O
an	O
Internet	O
Draft	O
.	O
</s>
<s>
SM4	B-Algorithm
is	O
part	O
of	O
the	O
ARMv8.4-A	O
expansion	O
to	O
the	O
ARM	O
architecture	O
.	O
</s>
