sm4

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sm4 implements ShangMi(SM) sm4 symmetric encryption algorithm.

Index

Constants

View Source
const (
	INST_AES int = iota
	INST_SM4
)
View Source
const BlockSize = 16

BlockSize the sm4 block size in bytes.

View Source
const KeySize = 16

Variables

This section is empty.

Functions

func NewCipher

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

NewCipher creates and returns a new cipher.Block implementation. The key argument should be the SM4 key, must be 16 bytes long.

Types

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

Jump to

Keyboard shortcuts

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