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

Public Member Functions

 __construct (CryptoInterface $cipher, $iv, $tagLength)
 
 decrypt ($data, $context)
 
 encrypt ($data, $context)
 

Protected Member Functions

 checkum ($M, $A)
 
 incrementCounter ($c)
 Increment the value of the counter by one.
 

Protected Attributes

 $cipher
 Cipher.
 
 $L
 Length parameter.
 
 $M
 Output tag length.
 
 $nonce
 Nonce.
 

Detailed Description

Counter with CBC-MAC (CCM)

Definition at line 11 of file CCM.php.

Constructor & Destructor Documentation

fpoirotte\Cryptal\Modes\CCM::__construct ( CryptoInterface  $impl,
  $iv,
  $tagLength 
)

Construct an encryption/decryption mode of operations.

Parameters
CryptoInterface$implCryptographic implementation.
string$ivInitialization Vector for the cipher.
int$tagLengthLength (in bytes) of the tags to generate (AEAD only).

Implements fpoirotte\Cryptal\SymmetricModeInterface.

Definition at line 25 of file CCM.php.

References fpoirotte\Cryptal\Modes\CCM\$cipher, fpoirotte\Cryptal\Modes\CCM\$L, fpoirotte\Cryptal\Modes\CCM\$M, and fpoirotte\Cryptal\Implementers\CryptoInterface\getBlockSize().

Member Function Documentation

fpoirotte\Cryptal\Modes\CCM::decrypt (   $data,
  $context 
)

Decrypt some data.

Parameters
string$dataData to decrypt.
resource$contextStream context for the operation.

Implements fpoirotte\Cryptal\AsymmetricModeInterface.

Definition at line 122 of file CCM.php.

References fpoirotte\Cryptal\Modes\CCM\$nonce, and fpoirotte\Cryptal\Modes\CCM\incrementCounter().

fpoirotte\Cryptal\Modes\CCM::encrypt (   $data,
  $context 
)

Encrypt some data.

Parameters
string$dataData to encrypt.
resource$contextStream context for the operation.

Implements fpoirotte\Cryptal\SymmetricModeInterface.

Definition at line 104 of file CCM.php.

References fpoirotte\Cryptal\Modes\CCM\$nonce, and fpoirotte\Cryptal\Modes\CCM\incrementCounter().


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