Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
一百万组,耗时约5.5秒
for (int i = 0; i < 1* 1000* 1000; i++)
{
cipher(data, text, key);
}
[root@localhost sm4]# g++ main.cpp
[root@localhost sm4]# time ./a.out
59,52,98,C7,
C6,FD,27,1F,
04,02,F8,04,
C3,3D,3F,66,
real 0m5.378s
user 0m5.369s
sys 0m0.007s
[root@localhost sm4]#
一千万组,耗时约50秒
for (int i = 0; i < 10* 1000* 1000; i++)
{
cipher(data, text, key);
}
[root@localhost sm4]# g++ main.cpp
[root@localhost sm4]# time ./a.out
EF,0E,D9,14,
B9,30,6C,74,
15,DC,EB,71,
E5,54,C5,6A,
real 0m48.186s
user 0m48.157s
sys 0m0.020s
[root@localhost sm4]#