Documentation ¶
Index ¶
- Constants
- func DecryptBytes_CBC(data, key, iv []byte) (out []byte, err error)
- func DecryptECB(data, key []byte) ([]byte, error)
- func Decrypt_CBC(data, key, iv string) (out string, err error)
- func Decrypt_ECB(data, key string) (out string, err error)
- func DiversifyKey(key, dvs string) (newkey string, err error)
- func EncryptBytes_CBC(data, key, iv []byte) (out []byte, err error)
- func EncryptECB(data, key []byte) ([]byte, error)
- func Encrypt_CBC(data, key, iv string) (out string, err error)
- func Encrypt_ECB(data, key string) (out string, err error)
- func GenerateKeyPair() ([]byte, error)
- func PbocMac(data, key, iv string) (out string, err error)
- func Pkcs7Padding(src []byte, blockSize int) []byte
- func Pkcs7UnPadding(src []byte, blockSize int) ([]byte, error)
- func SM2_GenerateKeyPair() (publicKey string, privateKey string, err error)
- func SM2_PrivateKey_Decrypt(cipher string, privKey string) (plain string, err error)
- func SM2_PublicKey_Encrypt(plain string, publicKey string) (cipher string, err error)
- func SM3_Hash(data string) (hash string)
- func SM4CryptCbc(key []byte, in []byte, iv []byte, flag int) ([]byte, error)
- func SM4CryptEcb(key []byte, in []byte, flag int) ([]byte, error)
- func SM4DiverseKey(dvsData []byte, dvsDataOffset int, ckKey []byte) ([]byte, error)
- func SM4PbocMac(key []byte, iv []byte, msg []byte, macLen int) ([]byte, error)
- func SM4_Decrypt_ECB(key, cipher string) (plain string, err error)
- func SM4_Encrypt_ECB(key, plain string) (cipher string, err error)
- func SignWithPrivate(key []byte, msg []byte) ([]byte, error)
- func VerifyWithPublic(key []byte, msg []byte, sig []byte) error
- type Sm4Cipher
Constants ¶
View Source
const ( // DECRYPT 解密模式 DECRYPT = 0 // ENCRYPT 加密模式 ENCRYPT = 1 )
View Source
const Sm4BlockSize = 16
Sm4BlockSize size of GM_SM4 block
Variables ¶
This section is empty.
Functions ¶
func DecryptBytes_CBC ¶ added in v1.0.2
func DecryptECB ¶
func Decrypt_CBC ¶ added in v1.0.2
func Decrypt_ECB ¶ added in v1.0.2
func DiversifyKey ¶ added in v1.0.2
func EncryptBytes_CBC ¶ added in v1.0.2
func EncryptECB ¶
func Encrypt_CBC ¶ added in v1.0.2
func Encrypt_ECB ¶ added in v1.0.2
func GenerateKeyPair ¶ added in v1.0.2
func Pkcs7Padding ¶ added in v1.0.2
func Pkcs7UnPadding ¶ added in v1.0.2
func SM2_GenerateKeyPair ¶ added in v1.0.2
func SM2_PrivateKey_Decrypt ¶ added in v1.0.2
func SM2_PublicKey_Encrypt ¶ added in v1.0.2
func SM4CryptCbc ¶ added in v1.0.2
SM4CryptEcb SM4加解密CBC flag 0:解密,1:加密
func SM4CryptEcb ¶ added in v1.0.2
SM4CryptEcb SM4加解密ECB flag 0:解密,1:加密
func SM4DiverseKey ¶ added in v1.0.2
func SM4PbocMac ¶ added in v1.0.2
func SM4_Decrypt_ECB ¶ added in v1.0.2
func SM4_Encrypt_ECB ¶ added in v1.0.2
Types ¶
Click to show internal directories.
Click to hide internal directories.