Documentation
¶
Overview ¶
Package sm4 handle shangmi sm4 symmetric encryption algorithm
Index ¶
- Constants
- func NewCipher(key []byte) (cipher.Block, error)
- func PKCS7Padding(src []byte) []byte
- func PKCS7UnPadding(src []byte) ([]byte, error)
- func Sm4DecryptCbc(encryptData, key, iv []byte) (plainData []byte, err error)
- func Sm4DecryptCfb(encryptData, key, iv []byte) (plainData []byte, err error)
- func Sm4DecryptGcm(encryptData, key, nonce []byte) ([]byte, error)
- func Sm4DecryptGcmWithNonce(encryptData, key, nonce, dst []byte) ([]byte, error)
- func Sm4DecryptOfb(encryptData, key, iv []byte) (plainData []byte, err error)
- func Sm4EncryptCbc(plainData, key []byte) (iv, encryptData []byte, err error)
- func Sm4EncryptCfb(plainData, key []byte) (iv, encryptData []byte, err error)
- func Sm4EncryptGcm(plainData, key []byte) (nonce, encryptData []byte, err error)
- func Sm4EncryptGcmWithNonce(plainData, key, nonce, dst []byte) (encryptData []byte, err error)
- func Sm4EncryptOfb(plainData, key []byte) (iv, encryptData []byte, err error)
Constants ¶
View Source
const ( INST_AES int = iota INST_SM4 )
View Source
const BlockSize = 16
BlockSize the sm4 block size in bytes.
Variables ¶
This section is empty.
Functions ¶
func NewCipher ¶
NewCipher creates and returns a new cipher.Block. The key argument should be the SM4 key,
func Sm4DecryptCbc ¶
Sm4DecryptCbc sm4解密,CBC模式
func Sm4DecryptCfb ¶
Sm4DecryptCfb sm4解密,CFB模式
func Sm4DecryptGcm ¶
Sm4DecryptGcm sm4解密,GCM模式
func Sm4DecryptGcmWithNonce ¶
Sm4DecryptGcmWithNonce sm4解密,GCM模式
func Sm4DecryptOfb ¶
Sm4DecryptOfb sm4解密,OFB模式
func Sm4EncryptCbc ¶
Sm4EncryptCbc sm4加密,CBC模式
func Sm4EncryptCfb ¶
Sm4EncryptCfb sm4加密,CFB模式
func Sm4EncryptGcm ¶
Sm4EncryptGcm sm4加密,GCM模式
func Sm4EncryptGcmWithNonce ¶
Sm4EncryptGcmWithNonce sm4加密,GCM模式
func Sm4EncryptOfb ¶
Sm4EncryptOfb sm4加密,OFB模式
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.