core

package
v0.0.0-...-f08c318 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package core implements some of the core algorithms of libsodium.

Index

Constants

View Source
const (
	HChacha20_OutputBytes = 32
	HChacha20_InputBytes  = 16
	HChacha20_KeyBytes    = 32
	HChacha20_ConstBytes  = 16
)
View Source
const (
	HSalsa20_OutputBytes = 32
	HSalsa20_InputBytes  = 16
	HSalsa20_KeyBytes    = 32
	HSalsa20_ConstBytes  = 16
)

Variables

View Source
var (
	Salsa20Sigma = [16]byte{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'}
)

Functions

func Equals

func Equals(a, b []byte) bool

Equals TODO

func HChacha20

func HChacha20(dst, nonce, key, sigma []byte) (out []byte)

HChacha20 implements the chacha20 hash function

func HSalsa20

func HSalsa20(dst, nonce, key, sigma []byte) (out []byte)

HSalsa20 implements the salsa20 hash function

func Increment

func Increment(buf []byte)

Increment adds 1 to the value of buf represented as a number in little endian form.

TODO implement in ASM?

func IsZero

func IsZero(buf []byte) (zero bool)

IsZero returns true if all bytes in buf are 0.

func Salsa20

func Salsa20(out *[64]byte, in *[16]byte, k *[32]byte, c *[16]byte)

Salsa20 implements the 20 round salsa20 core function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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