Namespace: ccm

sjcl.mode.ccm

CTR mode with CBC MAC.
Source:

Members

(static, constant) name

The name of the mode.
Source:

Methods

(static) decrypt(prf, ciphertext, iv, adataopt, tlenopt) → {bitArray}

Decrypt in CCM mode.
Parameters:
Name Type Attributes Default Description
prf Object The pseudorandom function. It must have a block size of 16 bytes.
ciphertext bitArray The ciphertext data.
iv bitArray The initialization value.
adata bitArray <optional>
[] adata The authenticated data.
tlen Number <optional>
64 tlen the desired tag length, in bits.
Source:
Returns:
The decrypted data.
Type
bitArray

(static) encrypt(prf, plaintext, iv, adataopt, tlenopt) → {bitArray}

Encrypt in CCM mode.
Parameters:
Name Type Attributes Default Description
prf Object The pseudorandom function. 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.
Source:
Returns:
The encrypted data, an array of bytes.
Type
bitArray