From 02258d23517d9060a8a681699cfcf9a0ca2a0955 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 27 Mar 2024 13:08:27 +0800 Subject: [PATCH] sm4: reduce slice checking internally --- sm4/cbc_cipher_asm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sm4/cbc_cipher_asm.go b/sm4/cbc_cipher_asm.go index 5820f38..2bea36d 100644 --- a/sm4/cbc_cipher_asm.go +++ b/sm4/cbc_cipher_asm.go @@ -64,7 +64,7 @@ func (x *cbc) CryptBlocks(dst, src []byte) { for len(src) >= BlockSize { // Write the xor to dst, then encrypt in place. subtle.XORBytes(dst[:BlockSize], src[:BlockSize], iv) - x.b.Encrypt(dst[:BlockSize], dst[:BlockSize]) + x.b.encrypt(dst[:BlockSize], dst[:BlockSize]) // Move to the next block with this block as the next iv. iv = dst[:BlockSize]