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

Public Member Functions

 __construct (MacEnum $macAlgorithm, SubAlgorithmAbstractEnum $innerAlgorithm, $key, $nonce= '')
 
- Public Member Functions inherited from fpoirotte\Cryptal\AbstractContextBasedAlgorithm
 __toString ()
 
 finalize ($raw=false)
 
 update ($data)
 
- Public Member Functions inherited from fpoirotte\Cryptal\ContextBasedInterface
 __toString ()
 
 finalize ($raw=false)
 
 update ($data)
 

Protected Member Functions

 internalFinalize ()
 
 internalUpdate ($data)
 
- Protected Member Functions inherited from fpoirotte\Cryptal\AbstractContextBasedAlgorithm
 internalFinalize ()
 
 internalUpdate ($data)
 

Private Attributes

 $r
 First half of secret key (second half in the specs due to endianness).
 
 $s
 Second half of secret key.
 

Additional Inherited Members

- Static Public Member Functions inherited from fpoirotte\Cryptal\Implementers\AbstractMac
static mac (MacEnum $macAlgorithm, SubAlgorithmAbstractEnum $innerAlgorithm, $key, $data, $nonce= '', $raw=false)
 

Detailed Description

Constructor & Destructor Documentation

fpoirotte\Cryptal\DefaultAlgorithms\Poly1305::__construct ( MacEnum  $macAlgorithm,
SubAlgorithmAbstractEnum  $innerAlgorithm,
  $key,
  $nonce = '' 
)

Construct a new context to generate a Message Authentication Code.

Parameters
MacEnum$macAlgorithmAlgorithm to use to produce the message authentication code.
SubAlgorithmAbstractEnum$innerAlgorithmInner algorithm used during generation. This should be either an instance of CipherEnum or MacEnum, depending on the value for the $macAlgorithm parameter.
Warning
For MAC algorithms that use ciphers, the cipher must be configured to use the Electronic Codebook (ECB) mode. Other modes of operations will result in garbage output.
Parameters
string$keySecret key used to produce the Message Authentication Code.
string$nonce(optional) Nonce used to randomize the output.
Note
Not all MAC algorithms make use of this parameter.

Implements fpoirotte\Cryptal\Implementers\MacInterface.

Definition at line 25 of file Poly1305.php.

References fpoirotte\Cryptal\DefaultAlgorithms\Poly1305\$r, and fpoirotte\Cryptal\DefaultAlgorithms\Poly1305\$s.


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