chacha20

package
v0.0.0-...-e2af113 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package ChaCha20 implements the core ChaCha20 function as specified in https://tools.ietf.org/html/rfc7539#section-2.3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XORKeyStream

func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte)

XORKeyStream crypts bytes from in to out using the given key and counters. In and out must overlap entirely or not at all. Counter contains the raw ChaCha20 counter bytes (i.e. block counter followed by nonce).

Types

type Rng

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

Rng is a stateful random number generator returning the ChaCha20 key stream.

func NewRng

func NewRng(key *[32]byte) *Rng

func (*Rng) Read

func (r *Rng) Read(p []byte) (n int, err error)

func (*Rng) ReadUint32

func (r *Rng) ReadUint32() uint32

ReadUint32 returns a uint32 extracted in little-endian from the output.

Jump to

Keyboard shortcuts

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