Class: SalmonAES256CTRTransformer

SalmonAES256CTRTransformer()

Abstract class for AES256 transformer implementations.

Constructor

new SalmonAES256CTRTransformer()

Source:

Classes

SalmonAES256CTRTransformer

Members

(static) BLOCK_SIZE

Salmon stream encryption block size, same as AES.
Source:

(static) EXPANDED_KEY_SIZE

Standard expansion key size for AES256 only.
Source:

Methods

getBlock() → {number}

Get the current block.
Source:
Returns:
The current block.
Type
number

getCounter() → {Uint8Array}

Get the current counter.
Source:
Returns:
The current counter.
Type
Uint8Array

getExpandedKey() → {Uint8Array|null}

Get the expanded key if available.
Source:
Returns:
The expanded key.
Type
Uint8Array | null

getKey() → {Uint8Array|null}

Get the current encryption key.
Source:
Returns:
The encryption key.
Type
Uint8Array | null

getNonce() → {Uint8Array|null}

Get the nonce (initial counter)
Source:
Returns:
The nonce.
Type
Uint8Array | null

increaseCounter(value)

Increase the Counter We use only big endianness for AES regardless of the machine architecture
Parameters:
Name Type Description
value number value to increase counter by
Source:

(async) init(key, nonce)

Initialize the transformer. Most common operations include precalculating expansion keys or any other prior initialization for efficiency.
Parameters:
Name Type Description
key Uint8Array The key
nonce Uint8Array The nonce
Source:
Throws:
SalmonSecurityException Thrown when error with security

resetCounter()

Resets the Counter and the block count.
Source:

setExpandedKey(expandedKey)

Set the expanded key. This should be called once during initialization phase.
Parameters:
Name Type Description
expandedKey Uint8Array The expanded key
Source:

syncCounter(position)

Syncs the Counter based on what AES block position the stream is at. The block count is already excluding the header and the hash signatures.
Parameters:
Name Type Description
position number The new position to sync to
Source: