padding

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type None

type None struct{}

func (None) Pad

func (None) Pad(data []byte, blockSize int) []byte

Pad returns the original byte slice.

func (None) Unpad

func (None) Unpad(data []byte, blockSize int) ([]byte, error)

Unpad returns the original byte slice.

type PKCS5

type PKCS5 struct{}

func (PKCS5) Pad

func (PKCS5) Pad(data []byte, blockSize int) []byte

Pad pads some bytes to the byte slice in pkcs5 way.

func (PKCS5) Unpad

func (PKCS5) Unpad(data []byte, blockSize int) ([]byte, error)

Unpad unpads some bytes from the byte slice in pkcs5 way.

type PKCS7

type PKCS7 struct{}

func (PKCS7) Pad

func (PKCS7) Pad(data []byte, blockSize int) []byte

Pad pads some bytes to the byte slice in pkcs7 way.

func (PKCS7) Unpad

func (PKCS7) Unpad(data []byte, blockSize int) ([]byte, error)

Unpad unpads some bytes from the byte slice in pkcs7 way.

type Padding

type Padding interface {
	// Pad pads some bytes to the byte slice.
	Pad(data []byte, blockSize int) []byte

	// Unpad unpads some bytes from the byte slice.
	Unpad(data []byte, blockSize int) ([]byte, error)
}

type Zero

type Zero struct{}

func (Zero) Pad

func (Zero) Pad(data []byte, blockSize int) []byte

Pad pads some bytes to the byte slice in zero way.

func (Zero) Unpad

func (Zero) Unpad(data []byte, blockSize int) ([]byte, error)

Unpad unpads some bytes from the byte slice in zero way.

Jump to

Keyboard shortcuts

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