Phil Rogaway's Offset CodeBook mode, version 2.0.
May be covered by US and international patents.
Members
(static, constant) name
The name of the mode.
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. |
Throws:
-
-
if the IV isn't exactly 128 bits.
-
-
-
if if the message is corrupt.
-
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. |
Throws:
-
if the IV isn't exactly 128 bits.
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. |