internal

package
v0.0.0-...-5d1c50d Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package internal contains various helper functions for writing STROBE protocols.

The subpackages of internal contain all the various STROBE protocols Veil uses.

Index

Constants

View Source
const (
	// MACSize is the MAC size in bytes.
	MACSize = 16

	// ElementSize is the length of an encoded ristretto255 element.
	ElementSize = 32

	// ScalarSize is the length of an encoded ristretto255 scalar.
	ScalarSize = 32

	// UniformBytestringSize is the length of a uniform bytestring which can be mapped to either a
	// ristretto255 element or scalar.
	UniformBytestringSize = 64
)

Variables

View Source
var ErrInvalidCiphertext = errors.New("invalid ciphertext")

ErrInvalidCiphertext is returned when the ciphertext cannot be decrypted.

Functions

func ASCIIDecode

func ASCIIDecode(text []byte) ([]byte, error)

ASCIIDecode decodes the given base58 text.

func ASCIIEncode

func ASCIIEncode(data []byte) []byte

ASCIIEncode returns the given data, encoded in base58.

func IntN

func IntN(max int) (int, error)

IntN returns a cryptographically random integer selected uniformly from [0,max).

func SliceForAppend

func SliceForAppend(in []byte, n int) (head, tail []byte)

SliceForAppend takes a slice and a requested number of bytes. It returns a slice with the contents of the given slice followed by that many bytes and a second slice that aliases into it and contains only the extra bytes. If the original slice has sufficient capacity then no allocation is performed.

Types

This section is empty.

Directories

Path Synopsis
Package hpke provides the underlying STROBE protocol for Veil's authenticated hybrid public key encryption system.
Package hpke provides the underlying STROBE protocol for Veil's authenticated hybrid public key encryption system.
Package mres provides the underlying STROBE protocol for Veil's multi-recipient encryption system.
Package mres provides the underlying STROBE protocol for Veil's multi-recipient encryption system.
Package pbenc implements memory-hard password-based encryption via STROBE using balloon hashing.
Package pbenc implements memory-hard password-based encryption via STROBE using balloon hashing.
Package scaldf provides the underlying STROBE protocols for Veil's scalar derivation functions, which derive ristretto255 scalars from other pieces of data.
Package scaldf provides the underlying STROBE protocols for Veil's scalar derivation functions, which derive ristretto255 scalars from other pieces of data.
Package schnorr provides the underlying STROBE protocol for Veil's Schnorr signatures.
Package schnorr provides the underlying STROBE protocol for Veil's Schnorr signatures.

Jump to

Keyboard shortcuts

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