support

package
v0.0.0-...-dd73372 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: ISC Imports: 3 Imported by: 60

Documentation

Overview

Package support implements support functions and errors that are used by by other libsodium-go packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignedSlice

func AlignedSlice(size, alignment int) []byte

AlignedSlice returns a memory aligned slice

func BytePointer

func BytePointer(b []byte) *uint8

BytePointer returns a pointer to the start of a byte slice, or nil when the slice is empty.

func CheckIntInRange

func CheckIntInRange(n int, min int, max int, descrip string)

CheckIntInRange checks if the size of an integer is between a lower and upper boundaries.

func CheckSize

func CheckSize(buf []byte, expected int, descrip string)

CheckSize checks if the length of a byte slice is equal to the expected length, and panics when this is not the case.

func CheckSizeGreaterOrEqual

func CheckSizeGreaterOrEqual(a, b []byte, aDescription, bDescription string)

CheckSizeGreaterOrEqual checks if the length of a byte slice is greater or equal to that of a second byte slice.

func CheckSizeInRange

func CheckSizeInRange(buf []byte, min int, max int, descrip string)

CheckSizeInRange checks if the length of a byte slice is between a lower and upper boundaries.

func CheckSizeMin

func CheckSizeMin(buf []byte, min int, descrip string)

CheckSizeMin checks if the length of a byte slice is greater or equal than a minimum length, and panics when this is not the case.

func NilPanic

func NilPanic(t bool, description string)

NilPanic is a shorthand that results in a panic when called with true.

Types

type KeySizeError

type KeySizeError int

KeySizeError is an error that occurs when a key has an incorrect length.

func (KeySizeError) Error

func (k KeySizeError) Error() string

type NilPointerError

type NilPointerError string

NilPointerError is an error that occurs when a pointer is a nil pointer

func (NilPointerError) Error

func (k NilPointerError) Error() string

type NonceSizeError

type NonceSizeError int

NonceSizeError is an error that occurs when a nonce has an incorrect length.

func (NonceSizeError) Error

func (k NonceSizeError) Error() string

type VerificationError

type VerificationError struct{}

VerificationError is an error that occurs when the verification of a signature or authentication tag fails.

func (VerificationError) Error

func (k VerificationError) Error() string

Jump to

Keyboard shortcuts

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