Class: SalmonGenerator

SalmonGenerator()

Utility class that generates secure random byte arrays.

Constructor

new SalmonGenerator()

Source:

Members

(static) BLOCK_SIZE

Should be 16 for AES256 the same as the iv.
Source:

(static) CHUNK_SIZE_LENGTH

Chunk size format length.
Source:

(static) HASH_KEY_LENGTH

HASH Key length for integrity, currently we use HMAC SHA256.
Source:

(static) HASH_RESULT_LENGTH

Hash signature size for integrity, currently we use HMAC SHA256.
Source:

(static) KEY_LENGTH

Encryption key length for AES256.
Source:

(static) MAGIC_LENGTH

Lenght for the magic bytes.
Source:

(static) NONCE_LENGTH

Nonce size.
Source:

(static) VERSION

Version.
Source:

(static) VERSION_LENGTH

Length for the Version in the data header.
Source:

Methods

(static) getMagicBytes() → {Uint8Array}

Gets the fixed magic bytes array
Source:
Returns:
The magic bytes
Type
Uint8Array

(static) getSecureRandomBytes(size)

Returns a secure random byte array. To be used when generating keys, initial vectors, and nonces.
Parameters:
Name Type Description
size number The size of the byte array.
Source:
Returns:
The random secure byte array.

(static) getVersion() → {number}

Returns the current Salmon format version.
Source:
Returns:
The current version
Type
number