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

Public Member Functions

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

Protected Member Functions

 hash ($A)
 

Static Protected Member Functions

static ntz ($n)
 

Protected Attributes

 $cipher
 Approved block cipher with a 128-bit block size.
 
 $iv
 Initialization Vector.
 
 $key
 Secret key.
 
 $taglen
 Output tag length (in bytes)
 

Detailed Description

Offset Codebook (OCB) mode

Note
Even though OCB was carefully designed to work with arbitrary bitstrings, this implementation only supports bytestrings, that is, strings whose length is a multiple of 8 bits.

Definition at line 16 of file OCB.php.

Constructor & Destructor Documentation

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

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

Member Function Documentation

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

Decrypt some data.

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

Implements fpoirotte\Cryptal\AsymmetricModeInterface.

Definition at line 117 of file OCB.php.

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

Encrypt some data.

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

Implements fpoirotte\Cryptal\SymmetricModeInterface.

Definition at line 76 of file OCB.php.


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