sm4

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 7 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 WriteKeyToPem

func WriteKeyToPem(FileName string, key SM4Key, pwd []byte) error

Types

type SM4Key

type SM4Key []byte

func ReadKeyFromPem

func ReadKeyFromPem(FileName string, pwd []byte) (SM4Key, error)

type Sm4Cipher

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

Cipher is an instance of SM4 encryption.

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