mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-28 13:16:19 +08:00
sm4: reduce slice checking internally
This commit is contained in:
parent
34dd5104ee
commit
02258d2351
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user