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

Public Member Functions

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

Protected Member Functions

 gctr ($ICB, $X)
 
 ghash ($X)
 
 padIv ()
 

Static Protected Member Functions

static inc ($X, $n)
 

Protected Attributes

 $cipher
 Approved block cipher with a 128-bit block size.
 
 $iv
 Initialization Vector.
 
 $key
 Secret key.
 
 $table
 Pre-computation table for GF(2**128)
 
 $taglen
 Output tag length (in bytes)
 

Detailed Description

Galois-counter mode

Definition at line 11 of file GCM.php.

Constructor & Destructor Documentation

fpoirotte\Cryptal\Modes\GCM::__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 28 of file GCM.php.

References fpoirotte\Cryptal\Modes\GCM\$cipher, fpoirotte\Cryptal\Modes\GCM\$iv, fpoirotte\Cryptal\Implementers\CryptoInterface\encrypt(), and fpoirotte\Cryptal\Implementers\CryptoInterface\getBlockSize().

Member Function Documentation

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

Decrypt some data.

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

Implements fpoirotte\Cryptal\AsymmetricModeInterface.

Definition at line 181 of file GCM.php.

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

Encrypt some data.

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

Implements fpoirotte\Cryptal\SymmetricModeInterface.

Definition at line 157 of file GCM.php.


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