ChaCha20ParameterSpec

class ChaCha20ParameterSpec : AlgorithmParameterSpec
kotlin.Any
   ↳ javax.crypto.spec.ChaCha20ParameterSpec

This class specifies the parameters used with the ChaCha20 algorithm.

The parameters consist of a 12-byte nonce and an initial counter value expressed as a 32-bit integer.

This class can be used to initialize a Cipher object that implements the ChaCha20 algorithm.

Summary

Public constructors
ChaCha20ParameterSpec(nonce: ByteArray!, counter: Int)

Constructs a parameter set for ChaCha20 from the given nonce and counter.

Public methods
Int

Returns the configured counter value.

ByteArray!

Returns the nonce value.

Public constructors

ChaCha20ParameterSpec

ChaCha20ParameterSpec(
    nonce: ByteArray!,
    counter: Int)

Constructs a parameter set for ChaCha20 from the given nonce and counter.

Parameters
nonce ByteArray!: a 12-byte nonce value
counter Int: the initial counter value
Exceptions
java.lang.NullPointerException if nonce is null
java.lang.IllegalArgumentException if nonce is not 12 bytes in length

Public methods

getCounter

fun getCounter(): Int

Returns the configured counter value.

Return
Int the counter value

getNonce

fun getNonce(): ByteArray!

Returns the nonce value.

Return
ByteArray! the nonce value. This method returns a new array each time this method is called.