Namespace: ocb2

sjcl.mode.ocb2

Phil Rogaway's Offset CodeBook mode, version 2.0. May be covered by US and international patents.
Author:
  • Emily Stark
  • Mike Hamburg
  • Dan Boneh
Source:

Members

(static, constant) name

The name of the mode.
Source:

Methods

(static) decrypt(prp, ciphertext, iv, adataopt, tlenopt, premacopt)

Decrypt in OCB mode.
Parameters:
Name Type Attributes Default Description
prp Object The block cipher. It must have a block size of 16 bytes.
ciphertext bitArray The ciphertext data.
iv bitArray The initialization value.
adata bitArray <optional>
[] The authenticated data.
tlen Number <optional>
64 the desired tag length, in bits.
premac boolean <optional>
false true if the authentication data is pre-macced with PMAC.
Source:
Throws:
Returns:
The decrypted data, an array of bytes.

(static) encrypt(prp, plaintext, iv, adataopt, tlenopt, premacopt)

Encrypt in OCB mode, version 2.0.
Parameters:
Name Type Attributes Default Description
prp Object The block cipher. It must have a block size of 16 bytes.
plaintext bitArray The plaintext data.
iv bitArray The initialization value.
adata bitArray <optional>
[] The authenticated data.
tlen Number <optional>
64 the desired tag length, in bits.
premac boolean <optional>
false true if the authentication data is pre-macced with PMAC.
Source:
Throws:
if the IV isn't exactly 128 bits.
Type
sjcl.exception.invalid
Returns:
The encrypted data, an array of bytes.

(static) pmac(prp, adata)

PMAC authentication for OCB associated data.
Parameters:
Name Type Description
prp Object The block cipher. It must have a block size of 16 bytes.
adata bitArray The authenticated data.
Source: