Skip to content

Commit

Permalink
sm4: ppc64x, gcm fix package usage #249
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Sep 13, 2024
1 parent e8d1100 commit 7e966a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sm4/gcm_ppc64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7e966a5

Please sign in to comment.