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

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)
 

Static Protected Attributes

static $polynomials
 

Static Private Member Functions

static mul2mod ($n, $l)
 

Private Attributes

 $cipher
 
 $data
 
 $k1
 
 $k2
 

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

Cipher-based message authentication code.

Definition at line 18 of file Cmac.php.

Constructor & Destructor Documentation

fpoirotte\Cryptal\DefaultAlgorithms\Cmac::__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 42 of file Cmac.php.

Member Data Documentation

fpoirotte\Cryptal\DefaultAlgorithms\Cmac::$polynomials
staticprotected
Initial value:
= array(
48 => "\x00\x2D",
64 => "\x00\x1B",
96 => "\x06\x41",
128 => "\x00\x87",
160 => "\x00\x2D",
192 => "\x00\x87",
224 => "\x03\x09",
256 => "\x04\x25",
384 => "\x10\x0D",
512 => "\x01\x25",
)

See http://sci.crypt.narkive.com/3lS5EbY4/ and http://www.hpl.hp.com/techreports/98/HPL-98-135.pdf

Definition at line 24 of file Cmac.php.


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