SDK for PHP 3.x

Gmac
in package
Uses NeedsTrait

Class Gmac

Table of Contents

Constants

BLOCK_SIZE  = 16

Methods

__construct()  : mixed
Gmac constructor.
finish()  : ByteArray
Finish processing the authentication tag.
flush()  : self
Finish processing any leftover bytes in the internal buffer.
needs()  : mixed
Preconditions, postconditions, and loop invariants are very useful for safe programing. They also document the specifications.
update()  : self
Update the object with some data.

Constants

BLOCK_SIZE

public mixed BLOCK_SIZE = 16

Methods

__construct()

Gmac constructor.

public __construct(Key $aesKey, string $nonce[, int $keySize = 256 ]) : mixed
Parameters
$aesKey : Key
$nonce : string
$keySize : int = 256

finish()

Finish processing the authentication tag.

public finish(int $aadLength, int $ciphertextLength) : ByteArray

This method mutates this Gmac object (effectively resetting it).

Parameters
$aadLength : int
$ciphertextLength : int
Return values
ByteArray

flush()

Finish processing any leftover bytes in the internal buffer.

public flush() : self
Return values
self

needs()

Preconditions, postconditions, and loop invariants are very useful for safe programing. They also document the specifications.

public static needs( $condition,  $errorMessage[, null $exceptionClass = null ]) : mixed

This function is to help simplify the semantic burden of parsing these constructions.

Instead of constructions like if (!(GOOD CONDITION)) { throw new \Exception('condition not true'); }

you can write: needs(GOOD CONDITION, 'condition not true');

Parameters
$condition :
$errorMessage :
$exceptionClass : null = null

update()

Update the object with some data.

public update(ByteArray $blocks) : self

This method mutates this Gmac object.

Parameters
$blocks : ByteArray
Return values
self
On this page