crypt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMCrypt

type CMCrypt struct {
}

func (*CMCrypt) Decrypt

func (c *CMCrypt) Decrypt(enData []byte, key []byte, iv []byte) (data []byte, err error)

func (*CMCrypt) DecryptE

func (c *CMCrypt) DecryptE(enData []byte, priKey []byte) (data []byte, err error)

func (*CMCrypt) Encrypt

func (c *CMCrypt) Encrypt(data []byte, key []byte, iv []byte) (enData []byte, err error)

func (*CMCrypt) EncryptE

func (c *CMCrypt) EncryptE(data []byte, pubKey []byte) (enData []byte, err error)

func (*CMCrypt) GenKey

func (c *CMCrypt) GenKey() (priKey []byte, pubKey []byte, err error)

func (*CMCrypt) Hash

func (c *CMCrypt) Hash(data ...[]byte) []byte

func (*CMCrypt) NewHash

func (c *CMCrypt) NewHash() hash.Hash

func (*CMCrypt) Sign

func (c *CMCrypt) Sign(data []byte, priKey []byte) (signature []byte, err error)

func (*CMCrypt) Verify

func (c *CMCrypt) Verify(data []byte, signature []byte, pubKey []byte) bool

type Crypt

type Crypt interface {
	Hash(data ...[]byte) []byte
	NewHash() hash.Hash
	Encrypt(data []byte, key []byte, iv []byte) (enData []byte, err error)
	Decrypt(enData []byte, key []byte, iv []byte) (data []byte, err error)
	GenKey() (priKey []byte, pubKey []byte, err error)
	Sign(data []byte, priKey []byte) (signature []byte, err error)
	Verify(data []byte, signature []byte, pubKey []byte) bool
	EncryptE(data []byte, pubKey []byte) (enData []byte, err error)
	DecryptE(enData []byte, priKey []byte) (data []byte, err error)
}

type GMCrypt

type GMCrypt struct {
}

func (*GMCrypt) Decrypt

func (c *GMCrypt) Decrypt(enData []byte, key []byte, iv []byte) (data []byte, err error)

func (*GMCrypt) DecryptE

func (c *GMCrypt) DecryptE(enData []byte, priKey []byte) (data []byte, err error)

func (*GMCrypt) Encrypt

func (c *GMCrypt) Encrypt(data []byte, key []byte, iv []byte) (enData []byte, err error)

func (*GMCrypt) EncryptE

func (c *GMCrypt) EncryptE(data []byte, pubKey []byte) (enData []byte, err error)

func (*GMCrypt) GenKey

func (c *GMCrypt) GenKey() (priKey []byte, pubKey []byte, err error)

func (*GMCrypt) Hash

func (c *GMCrypt) Hash(data ...[]byte) []byte

func (*GMCrypt) NewHash

func (c *GMCrypt) NewHash() hash.Hash

func (*GMCrypt) Sign

func (c *GMCrypt) Sign(data []byte, priKey []byte) (signature []byte, err error)

func (*GMCrypt) Verify

func (c *GMCrypt) Verify(data []byte, signature []byte, pubKey []byte) bool

Jump to

Keyboard shortcuts

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