xchacha20poly1305

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CipherID = "xc20p"
)

Variables

This section is empty.

Functions

func Register

func Register(algs h2cipher.Algs)

Register registers a cipher alg

Types

type Cipher

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

Cipher implements h2cipher.Cipher for xchacha20-poly1305

func New

func New(config Config) (*Cipher, error)

New creates a new xchacha20-poly1305 cipher

func NewFromParams

func NewFromParams(params string) (*Cipher, error)

NewFromParams creates a xchacha20-poly1305 cipher from params

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(ciphertext string) ([]byte, error)

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(plaintext []byte) (string, error)

func (*Cipher) ID

func (c *Cipher) ID() string

type Config

type Config struct {
	Key []byte
}

Config are xchacha20-poly1305 params

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates a new xchacha20-poly1305 config

func ParseConfig

func ParseConfig(params string) (*Config, error)

ParseConfig loads a xchacha20-poly1305 config from params string

func (Config) String

func (c Config) String() string

Jump to

Keyboard shortcuts

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