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

Public Member Functions

 __toString ()
 
 finalize ($raw=false)
 
 update ($data)
 

Protected Member Functions

 internalFinalize ()
 
 internalUpdate ($data)
 

Private Attributes

 $finalized = false
 

Detailed Description

Definition at line 5 of file AbstractContextBasedAlgorithm.php.

Member Function Documentation

fpoirotte\Cryptal\AbstractContextBasedAlgorithm::__toString ( )
final

Return the Message Authentication Code associated with the current context, in hexadecimal form.

Return values
stringMessage Authentication Code

Definition at line 63 of file AbstractContextBasedAlgorithm.php.

fpoirotte\Cryptal\AbstractContextBasedAlgorithm::finalize (   $raw = false)
final

Finalize the computation and return the resulting value.

Parameters
bool$raw(optional) Whether the result should be returned in its raw form (true) or using its hexadecimal representation (false). Defaults to false.
Return values
stringValue resulting from the computation.
Note
Once this method has been called, the context is marked as expired and can no longer be used. Trying to reuse an expired context will result in an error.

Definition at line 45 of file AbstractContextBasedAlgorithm.php.

References fpoirotte\Cryptal\AbstractContextBasedAlgorithm\internalFinalize().

fpoirotte\Cryptal\AbstractContextBasedAlgorithm::internalFinalize ( )
abstractprotected

Finalize the computation and return the computed Message Authentication Code in raw form.

Return values
stringRaw Message Authentication Code (binary form).

Referenced by fpoirotte\Cryptal\AbstractContextBasedAlgorithm\finalize().

fpoirotte\Cryptal\AbstractContextBasedAlgorithm::internalUpdate (   $data)
abstractprotected

Update the internal state using the given data.

Parameters
string$dataAdditional data to process.
Return values
objectReturns this instance.

Member Data Documentation

fpoirotte\Cryptal\AbstractContextBasedAlgorithm::$finalized = false
private

Flag indicating whether this context is expired or not

Definition at line 8 of file AbstractContextBasedAlgorithm.php.


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