sm4

package
v0.7.1-b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BlockSize = 16

Variables

This section is empty.

Functions

func NewCipher

func NewCipher(key []byte) (cipher.Block, error)

NewCipher creates and returns a new cipher.Block.

func Sm4Cbc

func Sm4Cbc(hexKey string, cipherText string, encryptMode bool, cbcIV []byte) (outStr string, err error)

func Sm4Ecb

func Sm4Ecb(hexKey string, cipherText string, encryptMode bool) (outStr string, err error)

Types

type SM4Key

type SM4Key []byte

type Sm4Cipher

type Sm4Cipher struct {
	// contains filtered or unexported fields
}

func (*Sm4Cipher) BlockSize

func (c *Sm4Cipher) BlockSize() int

func (*Sm4Cipher) Decrypt

func (c *Sm4Cipher) Decrypt(dst, src []byte)

func (*Sm4Cipher) Encrypt

func (c *Sm4Cipher) Encrypt(dst, src []byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL