Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sm4CBCDecrypt ¶
func Sm4CBCEncrypt ¶
func Sm4ECBDecrypt ¶
Example ¶
cipher, err := hex.DecodeString(cipherPreset)
if err != nil {
fmt.Println(err)
}
key, err := hex.DecodeString(keyPreset)
if err != nil {
fmt.Println(err)
}
plain, err := Sm4ECBDecrypt(key, cipher)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%x", plain)
Output: 0123456789abcdeffedcba9876543210
func Sm4ECBEncrypt ¶
Example ¶
plain, err := hex.DecodeString(plainPreset)
if err != nil {
fmt.Println(err)
}
key, err := hex.DecodeString(keyPreset)
if err != nil {
fmt.Println(err)
}
cipher, err := Sm4ECBEncrypt(key, plain)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%x", cipher)
Output: 681edf34d206965e86b3e94f536e4246002a8a4efa863ccad024ac0300bb40d2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.