NonceStrategy

sealed interface NonceStrategy(source)

Deprecated

'NonceStrategy' is no longer a strategy of choosing encryption mode at runtime and the API will be changing in the near future.

An encryption mode, regarding the nonce, supported by Discord.

Inheritors

Properties

Link copied to clipboard
abstract val nonceLength: Int

The amount of bytes this nonce will take up.

Functions

Link copied to clipboard
abstract fun append(nonce: ByteArrayView, cursor: MutableByteArrayCursor)

Writes the nonce to cursor in the correct relative position.

Link copied to clipboard
abstract fun generate(header: () -> ByteArrayView): ByteArrayView

Generates a nonce, may use the provided information.

Link copied to clipboard
abstract fun strip(packet: RTPPacket): ByteArrayView

Reads the nonce from this packet (also removes it if it resides in the payload), and returns a ByteArrayView of it.