XofDelegate

protected abstract inner class XofDelegate(delegate: A) : Xof<A> , Algorithm, Resettable, Updatable(source)

Wrapper for a Digest, Mac, etc. to act as a delegate to the Xof.

Throws

ClassCastException

if delegate is:

IllegalArgumentException

if delegate is:

Constructors

Link copied to clipboard
protected constructor(delegate: A)

Properties

Link copied to clipboard
@JvmField
protected val delegate: A

Functions

Link copied to clipboard
open override fun algorithm(): String
Link copied to clipboard
abstract fun copy(): Xof<A>
Link copied to clipboard
protected override fun newReader(): Xof.Reader<A>

protected abstract fun newReader(delegateCopy: A): Xof.Reader<A>

Returns a new Xof.Reader for the snapshot (i.e. copy) of delegate in its current state.

Link copied to clipboard
@JvmOverloads
fun reader(resetXof: Boolean = true): Xof.Reader<A>

Takes a snapshot of the current Xof's state and produces a Reader.

Link copied to clipboard
open override fun reset()
Link copied to clipboard
@JvmStatic
fun <A : ReKeyableXofAlgorithm> Xof<A>.reset(newKey: ByteArray)

Helper to provide access to the instance backing Xof, if said instance can be re-keyed (such as a org.kotlincrypto.core.mac.Mac).

Link copied to clipboard
open override fun update(input: Byte)
open override fun update(input: ByteArray)
open override fun update(input: ByteArray, offset: Int, len: Int)
Link copied to clipboard
@JvmOverloads
inline fun <T> use(resetXof: Boolean = true, action: Xof.Reader<A>.() -> T): T

Takes a snapshot of the current Xof's state and produces a Reader.