stdxgit.sr.ht/~pingoo/stdx/crypto/chacha20blake3 Index | Files

package chacha20blake3

import "git.sr.ht/~pingoo/stdx/crypto/chacha20blake3"

Index

Constants

const (
	KeySize   = 32
	NonceSize = 8
	TagSize   = 32
)
const (
	NonceSizeX = 24
)

Variables

var (
	ErrOpen           = errors.New("chacha20blake3: error decrypting ciphertext")
	ErrBadKeyLength   = errors.New("chacha20blake3: bad key length for ChaCha20Blake3. 32 bytes required")
	ErrBadNonceLength = errors.New("chacha20blake3: bad nonce length for ChaCha20Blake3. 8 bytes required")
)
var (
	ErrBadNonceXLength = errors.New("chacha20blake3: bad nonce length for XChaCha20Blake3. 24 bytes required")
)

Types

type ChaCha20Blake3

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

func New

func New(key []byte) (*ChaCha20Blake3, error)

func (*ChaCha20Blake3) NonceSize

func (*ChaCha20Blake3) NonceSize() int

func (*ChaCha20Blake3) Open

func (cipher *ChaCha20Blake3) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error)

func (*ChaCha20Blake3) Overhead

func (*ChaCha20Blake3) Overhead() int

func (*ChaCha20Blake3) Seal

func (cipher *ChaCha20Blake3) Seal(dst, nonce, plaintext, additionalData []byte) []byte

type XChaCha20Blake3

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

func NewX

func NewX(key []byte) (*XChaCha20Blake3, error)

func (*XChaCha20Blake3) NonceSize

func (*XChaCha20Blake3) NonceSize() int

func (*XChaCha20Blake3) Open

func (x *XChaCha20Blake3) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error)

func (*XChaCha20Blake3) Overhead

func (*XChaCha20Blake3) Overhead() int

func (*XChaCha20Blake3) Seal

func (x *XChaCha20Blake3) Seal(dst, nonce, plaintext, additionalData []byte) []byte

Source Files

chacha20_blake3.go xchacha20_blake3.go

Version
v0.0.0-20240218134121-094174641f6e (latest)
Published
Feb 18, 2024
Platform
linux/amd64
Imports
7 packages
Last checked
4 months ago

Tools for package owners.