Documentation ¶
Overview ¶
Package support implements support functions and errors that are used by by other libsodium-go packages.
Index ¶
- func AlignedSlice(size, alignment int) []byte
- func BytePointer(b []byte) *uint8
- func CheckIntInRange(n int, min int, max int, descrip string)
- func CheckSize(buf []byte, expected int, descrip string)
- func CheckSizeGreaterOrEqual(a, b []byte, aDescription, bDescription string)
- func CheckSizeInRange(buf []byte, min int, max int, descrip string)
- func CheckSizeMin(buf []byte, min int, descrip string)
- func NilPanic(t bool, description string)
- type KeySizeError
- type NilPointerError
- type NonceSizeError
- type VerificationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignedSlice ¶
AlignedSlice returns a memory aligned slice
func BytePointer ¶
BytePointer returns a pointer to the start of a byte slice, or nil when the slice is empty.
func CheckIntInRange ¶
CheckIntInRange checks if the size of an integer is between a lower and upper boundaries.
func CheckSize ¶
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 ¶
CheckSizeGreaterOrEqual checks if the length of a byte slice is greater or equal to that of a second byte slice.
func CheckSizeInRange ¶
CheckSizeInRange checks if the length of a byte slice is between a lower and upper boundaries.
func CheckSizeMin ¶
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.
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