Class: ZeroPadding

ZeroPadding

Implements Zero Padding functionality. Data is padded to the correct block length multiple with zero bytes.

new ZeroPadding(data)

Creates a new ZeroPadding padding mode instance
Parameters:
Name Type Description
data Object Initialization options for the class, passed automatically into ZeroPadding#initialize
Source:

Extends

Methods

do_pad(data) → {string}

Perform the padding on the data.
Parameters:
Name Type Description
data string A binary data string (ASCII)
Source:
Returns:
Padded data
Type
string

initialize(data) → {PaddingMode}

Invoked during subclass instantiation. All properties needed to initialize the class must be passed in.
Parameters:
Name Type Description
data Object A list of properties used to initialize the class.
Properties
Name Type Description
cipher BlockCipher A reference to a BlockCipher subclass instance. Used to get information about the block size.
Inherited From:
Source:
Returns:
Type
PaddingMode

undo_pad(data) → {string}

There is no safe way to undo zero padding. Simply returns the input string.
Parameters:
Name Type Description
data string A binary data string (ASCII)
Source:
Returns:
The exact same string that was passed in.
Type
string