sm4: ppc64x, gcm fix package usage #249

This commit is contained in:
Sun Yimin 2024-09-13 14:35:43 +08:00 committed by GitHub
parent e8d1100481
commit 7e966a56de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,12 +8,13 @@ package sm4
import (
"crypto/cipher"
"crypto/subtle"
_subtle "crypto/subtle"
"encoding/binary"
"errors"
"runtime"
"github.com/emmansun/gmsm/internal/alias"
"github.com/emmansun/gmsm/internal/subtle"
)
// Assert that sm4CipherAsm implements the gcmAble interface.
@ -233,7 +234,7 @@ func (g *gcmAsm) Open(dst, nonce, ciphertext, data []byte) ([]byte, error) {
panic("cipher: invalid buffer overlap")
}
if subtle.ConstantTimeCompare(expectedTag[:g.tagSize], tag) != 1 {
if _subtle.ConstantTimeCompare(expectedTag[:g.tagSize], tag) != 1 {
// clear(out)
for i := range out {
out[i] = 0