Version: v0.31.5 Latest Latest

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 0



Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.



View Source
const (
	// KeySize is the size of the key used by this AEAD, in bytes.
	KeySize = 32
	// NonceSize is the size of the nonce used with this AEAD, in bytes.
	NonceSize = 24
	// TagSize is the size added from poly1305
	TagSize = 16
	// MaxPlaintextSize is the max size that can be passed into a single call of Seal
	MaxPlaintextSize = (1 << 38) - 64
	// MaxCiphertextSize is the max size that can be passed into a single call of Open,
	// this differs from plaintext size due to the tag
	MaxCiphertextSize = (1 << 38) - 48


This section is empty.


func HChaCha20

func HChaCha20(out *[32]byte, nonce *[16]byte, key *[32]byte)

HChaCha20 generates 32 pseudo-random bytes from a 128 bit nonce and a 256 bit secret key. It can be used as a key-derivation-function (KDF).

func New

func New(key []byte) (cipher.AEAD, error)

New returns a new xchachapoly1305 AEAD


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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