From 630811386dfd133b8c93ab2b3d1113b8490886a4 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 7 Apr 2021 10:16:46 +0800 Subject: [PATCH] =?UTF-8?q?Updated=20SM4=E6=80=A7=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SM4性能优化.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SM4性能优化.md b/SM4性能优化.md index 3b27e16..972eb44 100644 --- a/SM4性能优化.md +++ b/SM4性能优化.md @@ -121,6 +121,17 @@ XTS模式主要用于磁盘加密,不过基本没有用sm4直接作为磁盘 * [The XTS-AES Tweakable Block Cipher](https://luca-giuzzi.unibs.it/corsi/Support/papers-cryptography/1619-2007-NIST-Submission.pdf) * [AES-XTS Block Cipher Mode is used in Kingston's Encrypted USB Flash Drives](https://www.kingston.com/unitedstates/en/solutions/data-security/xts-encryption) + CPU: i5-8265U + goos: windows + goarch: amd64 + pkg: github.com/emmansun/gmsm/sm4_test + BenchmarkAES128XTS512-6 414715 2856 ns/op 179.30 MB/s 0 B/op 0 allocs/op + BenchmarkAES128XTS1K-6 214734 5608 ns/op 182.58 MB/s 0 B/op 0 allocs/op + BenchmarkAES128XTS4K-6 54001 22179 ns/op 184.68 MB/s 0 B/op 0 allocs/op + BenchmarkAES256XTS512-6 387740 3073 ns/op 166.63 MB/s 0 B/op 0 allocs/op + BenchmarkAES256XTS1K-6 197138 6100 ns/op 167.86 MB/s 0 B/op 0 allocs/op + BenchmarkAES256XTS4K-6 49514 24088 ns/op 170.04 MB/s 0 B/op 0 allocs/op + # 和AES的比较 相比而言,差距还是有点大,最大的是GCM sign/open, 有二十多倍。