mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-12 12:06:18 +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 {
|
for len(src) >= BlockSize {
|
||||||
// Write the xor to dst, then encrypt in place.
|
// Write the xor to dst, then encrypt in place.
|
||||||
subtle.XORBytes(dst[:BlockSize], src[:BlockSize], iv)
|
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.
|
// Move to the next block with this block as the next iv.
|
||||||
iv = dst[:BlockSize]
|
iv = dst[:BlockSize]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user