Versions in this module Expand all Collapse all v1 v1.0.1 Aug 31, 2021 Changes in this version + const BlockSize + func GCMDecrypt(K, IV, C, A []byte) (P, _T []byte) + func GCMEncrypt(K, IV, P, A []byte) (C, T []byte) + func GHASH(H []byte, A []byte, C []byte) (X []byte) + func GetH(key []byte) (H []byte) + func GetY0(H, IV []byte) []byte + func MSB(len int, S []byte) (out []byte) + func NewCipher(key []byte) (cipher.Block, error) + func Rightshift(V []byte) + func Sm4CFB(key []byte, in []byte, mode bool) (out []byte, err error) + func Sm4Cbc(key []byte, in []byte, mode bool) (out []byte, err error) + func Sm4Ecb(key []byte, in []byte, mode bool) (out []byte, err error) + func Sm4GCM(key []byte, IV, in, A []byte, mode bool) ([]byte, []byte, error) + func Sm4OFB(key []byte, in []byte, mode bool) (out []byte, err error) + func WriteKeyToPem(key SM4Key, pwd []byte) ([]byte, error) + func WriteKeyToPemFile(FileName string, key SM4Key, pwd []byte) error + type SM4Key []byte + func ReadKeyFromPem(data []byte, pwd []byte) (SM4Key, error) + func ReadKeyFromPemFile(FileName string, pwd []byte) (SM4Key, error) + type Sm4Cipher struct + func (c *Sm4Cipher) BlockSize() int + func (c *Sm4Cipher) Decrypt(dst, src []byte) + func (c *Sm4Cipher) Encrypt(dst, src []byte)