From 4ccc5c0f0b6d5fa38b9266f4e88d4986b84d488d Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 7 Apr 2021 10:24:25 +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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SM4性能优化.md b/SM4性能优化.md index 972eb44..57a908e 100644 --- a/SM4性能优化.md +++ b/SM4性能优化.md @@ -119,9 +119,12 @@ Golang没提供这两种模式的优化接口,可能这两种模式不怎么 XTS模式主要用于磁盘加密,不过基本没有用sm4直接作为磁盘加密算法的,最多作为CMK,用来加解密Data Key。 * [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) +* [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 + CPU: i5-9500 goos: windows goarch: amd64 pkg: github.com/emmansun/gmsm/sm4_test @@ -132,6 +135,7 @@ XTS模式主要用于磁盘加密,不过基本没有用sm4直接作为磁盘 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, 有二十多倍。