Files
xgcl/sm/sm4/gcm.go
T
2026-05-27 23:03:00 +08:00

13 lines
256 B
Go

package sm4
import "crypto/cipher"
// NewGCM return a standard AEAD for sm4-gcm of 12 bytes nonce and 16 bytes tag.
func NewGCM(key []byte) (cipher.AEAD, error) {
c, err := NewCipher(key)
if err != nil {
return nil, err
}
return cipher.NewGCM(c)
}