Documentation ¶
Overview ¶
Package padding provides functions to handle padding in block ciphers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWrongPadding = errors.New("wrong padding") ErrBadBlockSize = errors.New("bad block size") ErrDataSize = errors.New("input is not a multiple of block size") )
Errors
Functions ¶
This section is empty.
Types ¶
type Padding ¶
type Padding interface { // Pad appends padding to b to align it to a block size. // The block size must be greater than 1. Pad(b []byte, blockSize int) []byte // Strip removes the padding from b. The resulting slice will always // be a subslice of the argument. The block size must be greater than 1. Strip(b []byte, blockSize int) ([]byte, error) }
Padding is a padding algorithm.
var PKCS7 Padding = pkcs7{}
PKCS7 implements the padding algorithm as described in PKCS #7 section 10.3. The block size must be less than 256.
Click to show internal directories.
Click to hide internal directories.