padding

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2017 License: CC0-1.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToBinary

func IntToBinary(i int) []byte

IntToBinary encodes i into a byte slice as uint32. It panics if i is not a valid uint32.

func Length

func Length(maxlen int, nonce, key []byte) int

Length calculates length of padding for given nonce and key in range [0:maxlen). maxlen must be a power of two and maxlen < 2^32-1.

func Pad

func Pad(pt []byte, padlen int) []byte

Pad prepends padlen zero bytes to pt.

func Unpad

func Unpad(paddedpt []byte, padlen int) ([]byte, error)

Uppad removes first padlen bytes of paddedpt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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