\CryptoManana\Core\Traits\MessageEncryptionBlockOperationsTrait

Trait BlockOperationsTrait - Reusable implementation of `BlockOperationsInterface`.

Summary

Methods
Properties
Constants
setInitializationVector()
getInitializationVector()
setBlockOperationMode()
getBlockOperationMode()
setPaddingStandard()
getPaddingStandard()
$$iv
$$mode
$$padding
No constants found
validateBlockModeSupport()
$validBlockModes
N/A
No private methods found
No private properties found
N/A

Properties

$$iv

$$iv : string

The initialization vector (IV) string property storage.

Type

string

$$mode

$$mode : string

The block encryption operation mode string property.

Type

string

$$padding

$$padding : integer

The final block padding operation property.

Type

integer

$validBlockModes

$validBlockModes : array

List of valid block operation modes.

Type

array — Block mode codes.

Methods

setInitializationVector()

setInitializationVector(string  $iv) : $this

Setter for the initialization vector (IV) string property.

Parameters

string $iv

The initialization vector (IV) string.

Throws

\Exception

Validation errors.

Returns

$this —

The symmetric encryption algorithm object.

getInitializationVector()

getInitializationVector() : string

Getter for the initialization vector (IV) string property.

Returns

string —

The initialization vector (IV) string.

setBlockOperationMode()

setBlockOperationMode(string  $mode) : $this

Setter for the block encryption operation mode string property.

Parameters

string $mode

The block operation mode string.

Throws

\Exception

Validation errors.

Returns

$this —

The symmetric encryption algorithm object.

getBlockOperationMode()

getBlockOperationMode() : string

Getter for the block encryption operation mode string property.

Returns

string —

The block operation mode string.

setPaddingStandard()

setPaddingStandard(integer  $padding) : $this

Setter for the final block padding operation property.

Parameters

integer $padding

The padding standard integer code value.

Throws

\Exception

Validation errors.

Returns

$this —

The symmetric encryption algorithm object.

getPaddingStandard()

getPaddingStandard() : integer

Getter for the final block padding operation property.

Returns

integer —

The padding standard integer code value.

validateBlockModeSupport()

validateBlockModeSupport(string  $mode) 

Internal method for the validation of the system support of the given block operation mode.

Parameters

string $mode

The block mode name.

Throws

\Exception

Validation errors.