cryptal  latest
Cryptography Abstraction Layer
fpoirotte\Cryptal\Padding\None Class Reference
+ Inheritance diagram for fpoirotte\Cryptal\Padding\None:

Public Member Functions

 getPaddingData ($blockSize, $expectedSize)
 
 getPaddingSize ($paddedData, $blockSize)
 

Detailed Description

No padding at all.

This means that the input data is already expected to have a size that is a multiple of the block size. Do not use this class unless you know what you are doing.

Definition at line 14 of file None.php.

Member Function Documentation

fpoirotte\Cryptal\Padding\None::getPaddingData (   $blockSize,
  $expectedSize 
)

Return padding data to form a complete block.

Parameters
int$blockSizeThe cipher's block size, in bytes.
int$expectedSizeThe padding's expected size (in bytes) to form a (possibly new) complete block. This value is always such that: $ 0 < \$expectedSize <= \$blockSize $
Return values
stringPadding data.

Implements fpoirotte\Cryptal\PaddingInterface.

Definition at line 16 of file None.php.

fpoirotte\Cryptal\Padding\None::getPaddingSize (   $paddedData,
  $blockSize 
)

Return the size (in bytes) of the padding in some already-padded data.

Parameters
string$paddedDataThe padded data to analyze.
int$blockSizeThe cipher's block size, in bytes.
Exceptions
ExceptionAn exception is thrown when the supplied data is invalid (was not padded using the currently-selected scheme).
Warning
Some padding schemes can generate ambiguous data, resulting in possible data loss while removing the padding. This method suffers from the same shortcomings. If possible, you should not rely on this method to determine the plaintext's length. Instead, you should retrieve it using other means (eg. out-of-band communications).

Implements fpoirotte\Cryptal\PaddingInterface.

Definition at line 21 of file None.php.


The documentation for this class was generated from the following file: