KMAC128

constructor(key: ByteArray)(source)

Creates a new KMAC128 instance with a default output length of 32 bytes.

Throws

IllegalArgumentException

if key is empty.


constructor(key: ByteArray, S: ByteArray?)(source)

Creates a new KMAC128 instance with a default output length of 32 bytes.

Parameters

S

A user selected customization bit string to define a variant of the function. When no customization is desired, S is set to an empty or null value. (e.g. "My Customization".encodeToByteArray()).

Throws

IllegalArgumentException

if key is empty.


constructor(key: ByteArray, S: ByteArray?, outputLength: Int)(source)

Creates a new KMAC128 instance with a non-default output length.

Parameters

S

A user selected customization bit string to define a variant of the function. When no customization is desired, S is set to an empty or null value. (e.g. "My Customization".encodeToByteArray()).

outputLength

The number of bytes returned when doFinal is invoked

Throws

IllegalArgumentException

if key is empty, or outputLength is negative.