pssht  latest
SSH server library written in PHP
fpoirotte\Pssht\MAC\Base Class Reference
+ Inheritance diagram for fpoirotte\Pssht\MAC\Base:

Public Member Functions

 __construct ($key)
 
 compute ($seqno, $data)
 

Static Public Member Functions

static getKeySize ()
 
static getSize ()
 
static isAvailable ()
 
- Static Public Member Functions inherited from fpoirotte\Pssht\Algorithms\AlgorithmInterface
static getName ()
 Return the name of the algorithm.
 
- Static Public Member Functions inherited from fpoirotte\Pssht\MAC\BaseInterface
static getHash ()
 

Protected Attributes

 $key
 Secret key for MAC operations.
 

Detailed Description

Abstract class representing a MAC algorithm.

Definition at line 21 of file Base.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\MAC\Base::__construct (   $key)
final

Construct a new MAC algorithm.

Parameters
string$keyKey for the MAC algorithm.

Implements fpoirotte\Pssht\MAC\MACInterface.

Definition at line 29 of file Base.php.

References fpoirotte\Pssht\MAC\Base\$key.

Member Function Documentation

fpoirotte\Pssht\MAC\Base::compute (   $seqno,
  $data 
)
final

Compute the MAC for some data.

Parameters
int$seqnoSequence number of the message for which the MAC applies.
string$dataData whose MAC must be computed.
Return values
stringMAC for the given data.

Implements fpoirotte\Pssht\MAC\MACInterface.

Definition at line 34 of file Base.php.

static fpoirotte\Pssht\MAC\Base::getKeySize ( )
staticfinal

Get the size of a key compatible with this MAC algorithm.

Return values
intMAC key size in bytes.

Implements fpoirotte\Pssht\MAC\MACInterface.

Definition at line 40 of file Base.php.

static fpoirotte\Pssht\MAC\Base::getSize ( )
staticfinal

Get the size of a MAC signature generated with this algorithm.

Return values
intMAC size in bytes.

Implements fpoirotte\Pssht\MAC\MACInterface.

Definition at line 46 of file Base.php.

static fpoirotte\Pssht\MAC\Base::isAvailable ( )
staticfinal

Determine whether the algorithm is available.

Return values
booltrue if the algorithm is available, false otherwise.

Implements fpoirotte\Pssht\Algorithms\AvailabilityInterface.

Definition at line 51 of file Base.php.


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