mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 04:06:18 +08:00
sm4: ppc64x, gcm fix package usage #249
This commit is contained in:
parent
e8d1100481
commit
7e966a56de
@ -8,12 +8,13 @@ package sm4
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/cipher"
|
"crypto/cipher"
|
||||||
"crypto/subtle"
|
_subtle "crypto/subtle"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/alias"
|
"github.com/emmansun/gmsm/internal/alias"
|
||||||
|
"github.com/emmansun/gmsm/internal/subtle"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert that sm4CipherAsm implements the gcmAble interface.
|
// 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")
|
panic("cipher: invalid buffer overlap")
|
||||||
}
|
}
|
||||||
|
|
||||||
if subtle.ConstantTimeCompare(expectedTag[:g.tagSize], tag) != 1 {
|
if _subtle.ConstantTimeCompare(expectedTag[:g.tagSize], tag) != 1 {
|
||||||
// clear(out)
|
// clear(out)
|
||||||
for i := range out {
|
for i := range out {
|
||||||
out[i] = 0
|
out[i] = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user