pkcs7

package
v0.0.0-...-8bf613e Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pad

func Pad(data []byte, blockLen int) ([]byte, error)

Pad appends padding to the given buffer such that the resulting slice of bytes has a length divisible by the given size. If you are using this function to pad a plaintext before encrypting it with a block cipher, the size should be equal to the block size of the cipher (e.g., aes.BlockSize).

func Unpad

func Unpad(data []byte, blockLen int) ([]byte, error)

Unpad returns slice of original data without padding. It checks the correctness of the padding bytes in constant time, and returns an error if the padding bytes are malformed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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