Same setup as https://gist.github.com/ZenithalHourlyRate/7b5175734f87acb73d0bbc53391d7140 (aligned from openssl/openssl#18267 and Zbb/Zbc from openssl/openssl#17640)
I've made a PR openssl/openssl#18285
It turned out that both RV32/RV64 can use the same function (I removed RV64 specific asm) and here is the new benchmark
Start cbc for 2 sec
./openssl-c-long
SM4-CBC 1064.71k 1289.18k 1368.45k 1384.96k 1372.16k 1368.06k
./openssl-zksed-rvi-aligned
SM4-CBC 2549.08k 4217.95k 5020.29k 5270.53k 5234.69k 5096.33k
Start ecb for 2 sec
./openssl-c-long
SM4-ECB 1169.30k 1340.26k 1396.99k 1404.78k 1388.54k 1384.45k
./openssl-zksed-rvi-aligned
SM4-ECB 3131.71k 4545.34k 5240.45k 5459.62k 5373.95k 5219.83k
Start cfb for 2 sec
./openssl-c-long
SM4-CFB 1134.87k 1319.68k 1385.10k 1384.45k 1372.16k 1368.06k
./openssl-zksed-rvi-aligned
SM4-CFB 2909.79k 4367.14k 5067.65k 5280.26k 5218.30k 5062.66k
Start ctr for 2 sec
./openssl-c-long
SM4-CTR 1072.59k 1254.24k 1303.81k 1314.30k 1298.43k 1294.34k
./openssl-zksed-rvi-aligned
SM4-CTR 2575.82k 3699.07k 4203.14k 4361.31k 4278.97k 4186.11k
Start ofb for 2 sec
./openssl-c-long
SM4-OFB 1121.12k 1328.74k 1383.30k 1400.15k 1369.41k 1368.06k
./openssl-zksed-rvi-aligned
SM4-OFB 2810.17k 4380.69k 5111.68k 5305.34k 5259.26k 5103.62k
Start ccm for 2 sec
./openssl-c-long
SM4-CCM 294.40k 507.33k 623.02k 655.36k 667.65k 668.40k
./openssl-zksed-rvi-aligned
SM4-CCM 294.86k 508.72k 623.41k 655.36k 667.65k 668.40k
Start ocb for 2 sec
./openssl-c-long
./openssl-zksed-rvi-aligned
Start gcm for 2 sec
./openssl-c-long
SM4-GCM 674.22k 805.44k 839.27k 853.16k 843.65k 847.73k
./openssl-zksed-rvi-aligned
SM4-GCM 1320.50k 1603.57k 1708.29k 1733.12k 1716.22k 1703.61k
Start xts for 2 sec
./openssl-c-long
./openssl-zksed-rvi-aligned
Start gcm for 2 sec
./openssl-c-long
SM4-GCM 680.04k 812.51k 842.88k 849.92k 848.02k 847.73k
./openssl-zksed-rvi-aligned
SM4-GCM 2365.86k 3436.58k 3958.02k 4104.70k 4067.33k 3973.12k
Start ccm for 2 sec
./openssl-c-long
SM4-CCM 293.49k 505.73k 619.96k 653.82k 667.65k 665.09k
./openssl-xts
SM4-CCM 820.49k 1625.54k 2136.58k 2327.04k 2358.80k 2331.26k
Start cbc for 2 sec
./openssl-c-long
SM4-CBC 1062.26k 1298.14k 1368.19k 1393.46k 1372.16k 1368.06k
./openssl-zksed-zbkb-aligned
SM4-CBC 2722.61k 4180.42k 4785.54k 4971.01k 4927.49k 4784.13k
./openssl-zksed-aligned
SM4-CBC 2661.43k 4103.14k 4701.22k 4892.44k 4841.10k 4694.02k
Start ecb for 2 sec
./openssl-c-long
SM4-ECB 1175.97k 1340.45k 1398.02k 1406.46k 1395.52k 1377.56k
./openssl-zksed-zbkb-aligned
SM4-ECB 3348.52k 4547.78k 5068.80k 5205.93k 5103.62k 4939.90k
./openssl-zksed-aligned
SM4-ECB 3310.79k 4498.33k 4961.15k 5090.30k 5013.50k 4874.24k
Start cfb for 2 sec
./openssl-c-long
SM4-CFB 1121.37k 1320.81k 1383.30k 1393.78k 1372.16k 1368.06k
./openssl-zksed-zbkb-aligned
SM4-CFB 2960.60k 4341.68k 4849.72k 4998.05k 4911.10k 4767.74k
./openssl-zksed-aligned
SM4-CFB 2974.54k 4288.58k 4749.57k 4894.41k 4812.80k 4685.82k
Start ctr for 2 sec
./openssl-c-long
SM4-CTR 1064.59k 1252.53k 1308.17k 1313.28k 1296.72k 1294.34k
./openssl-zksed-zbkb-aligned
SM4-CTR 2775.49k 3671.20k 4049.54k 4147.20k 4096.00k 3989.50k
./openssl-zksed-aligned
SM4-CTR 2736.47k 3601.05k 3985.79k 4084.74k 4014.08k 3923.97k
Start ofb for 2 sec
./openssl-c-long
SM4-OFB 1123.45k 1323.38k 1383.04k 1388.83k 1376.26k 1368.06k
./openssl-zksed-zbkb-aligned
SM4-OFB 3185.52k 4266.29k 4908.25k 5044.87k 4952.06k 4808.70k
./openssl-zksed-aligned
SM4-OFB 2866.47k 4217.15k 4776.27k 4911.10k 4857.28k 4718.59k
Start ccm for 2 sec
./openssl-c-long
SM4-CCM 296.84k 509.47k 621.06k 656.90k 668.40k 671.74k
./openssl-zksed-zbkb-aligned
SM4-CCM 294.22k 507.87k 624.18k 656.90k 667.65k 671.74k
./openssl-zksed-aligned
SM4-CCM 292.93k 509.94k 621.22k 656.38k 671.74k 671.74k
Start ocb for 2 sec
./openssl-c-long
./openssl-zksed-zbkb-aligned
./openssl-zksed-aligned
Start gcm for 2 sec
./openssl-c-long
SM4-GCM 675.45k 808.10k 842.24k 853.68k 847.73k 851.97k
./openssl-zksed-zbkb-aligned
SM4-GCM 1232.71k 1488.74k 1579.05k 1598.46k 1584.34k 1581.06k
./openssl-zksed-aligned
SM4-GCM 1236.62k 1496.57k 1580.29k 1601.54k 1585.15k 1581.06k
Start xts for 2 sec
./openssl-c-long
./openssl-zksed-zbkb-aligned
./openssl-zksed-aligned
Start gcm for 2 sec (with Zbb/Zbc)
./openssl-c-long
SM4-GCM 676.48k 808.00k 842.62k 849.92k 848.02k 848.02k
./openssl-zksed-zbkb-aligned
SM4-GCM 2175.66k 3159.01k 3579.26k 3702.27k 3661.82k 3588.10k
./openssl-zksed-aligned
SM4-GCM 2196.04k 3221.12k 3586.82k 3727.57k 3665.92k 3614.36k