aes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateGCMNonce added in v0.3.3

func GenerateGCMNonce() (cryptox.Bytes, error)

GenerateGCMNonce generates a nonce for gcm.

Types

type AES added in v0.3.2

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

AES packs some function of aes.

func New added in v0.3.2

func New(key cryptox.Bytes) AES

New creates a new AES with key.

func (AES) DecryptCBC added in v0.3.2

func (a AES) DecryptCBC(unpadding cryptox.UnPadding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) DecryptCFB added in v0.3.2

func (a AES) DecryptCFB(unpadding cryptox.UnPadding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) DecryptCTR added in v0.3.2

func (a AES) DecryptCTR(unpadding cryptox.UnPadding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) DecryptECB added in v0.3.2

func (a AES) DecryptECB(unpadding cryptox.UnPadding, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) DecryptGCM added in v0.3.3

func (a AES) DecryptGCM(nonce cryptox.Bytes, bs cryptox.Bytes, additional cryptox.Bytes) (cryptox.Bytes, error)

DecryptGCM uses gcm mode to decrypt bs. NOTICE: This is an experimental function, and we haven't tested it enough yet, so be careful when using it.

func (AES) DecryptOFB added in v0.3.2

func (a AES) DecryptOFB(unpadding cryptox.UnPadding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) EncryptCBC added in v0.3.2

func (a AES) EncryptCBC(padding cryptox.Padding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) EncryptCFB added in v0.3.2

func (a AES) EncryptCFB(padding cryptox.Padding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) EncryptCTR added in v0.3.2

func (a AES) EncryptCTR(padding cryptox.Padding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) EncryptECB added in v0.3.2

func (a AES) EncryptECB(padding cryptox.Padding, bs cryptox.Bytes) (cryptox.Bytes, error)

func (AES) EncryptGCM added in v0.3.3

func (a AES) EncryptGCM(nonce cryptox.Bytes, bs cryptox.Bytes, additional cryptox.Bytes) (cryptox.Bytes, error)

EncryptGCM uses gcm mode to encrypt bs. NOTICE: This is an experimental function, and we haven't tested it enough yet, so be careful when using it.

func (AES) EncryptOFB added in v0.3.2

func (a AES) EncryptOFB(padding cryptox.Padding, iv cryptox.Bytes, bs cryptox.Bytes) (cryptox.Bytes, error)

Jump to

Keyboard shortcuts

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