Engine

protected expect abstract class Engine : Copyable<Mac.Engine> , Resettable, Updatable(source)

Core abstraction for powering a Mac implementation.

Implementors of Engine must initialize the instance with the provided key parameter.

protected actual abstract class Engine : MacSpi, Cloneable, Copyable<Mac.Engine> , Resettable, Updatable(source)

Core abstraction for powering a Mac implementation. Extends Java's MacSpi for compatibility.

Implementors of Engine must initialize the instance with the provided key parameter.

protected actual abstract class Engine : Copyable<Mac.Engine> , Resettable, Updatable(source)

Core abstraction for powering a Mac implementation.

Implementors of Engine must initialize the instance with the provided key parameter.

Constructors

Link copied to clipboard
expect constructor(key: ByteArray)

Initializes a new Engine with the provided key with the default resetOnDoFinal value of true (i.e. Engine.reset will be called automatically after Engine.doFinal or Engine.doFinalInto have been invoked).

expect constructor(key: ByteArray, resetOnDoFinal: Boolean)

Initializes a new Engine with the provided key and resetOnDoFinal configuration.

protected expect constructor(other: Mac.Engine)

Creates a new Engine from other, copying its state.

actual constructor(key: ByteArray)

Initializes a new Engine with the provided key with the default resetOnDoFinal value of true (i.e. Engine.reset will be called automatically after Engine.doFinal or Engine.doFinalInto have been invoked).

actual constructor(key: ByteArray, resetOnDoFinal: Boolean)

Initializes a new Engine with the provided key and resetOnDoFinal configuration.

protected actual constructor(other: Mac.Engine)

Creates a new Engine from other, copying its state.

actual constructor(key: ByteArray)

Initializes a new Engine with the provided key with the default resetOnDoFinal value of true (i.e. Engine.reset will be called automatically after Engine.doFinal or Engine.doFinalInto have been invoked).

actual constructor(key: ByteArray, resetOnDoFinal: Boolean)

Initializes a new Engine with the provided key and resetOnDoFinal configuration.

protected actual constructor(other: Mac.Engine)

Creates a new Engine from other, copying its state.

Properties

Link copied to clipboard
@JvmField
expect val resetOnDoFinal: Boolean

Most Mac.Engine are backed by a Digest, whereby calling reset after doFinal will cause a double reset (because Digest.digest does this inherently). By setting this value to false, Engine.reset will not be called whenever doFinal gets invoked.

@JvmField
actual val resetOnDoFinal: Boolean

Most Mac.Engine are backed by a Digest, whereby calling reset after doFinal will cause a double reset (because Digest.digest does this inherently). By setting this value to false, Engine.reset will not be called whenever doFinal gets invoked.

@JvmField
actual val resetOnDoFinal: Boolean

Most Mac.Engine are backed by a Digest, whereby calling reset after doFinal will cause a double reset (because Digest.digest does this inherently). By setting this value to false, Engine.reset will not be called whenever doFinal gets invoked.

Functions

Link copied to clipboard
expect abstract fun doFinal(): ByteArray

Completes the computation, performing final operations and returning the resultant array of bytes. The Engine is reset afterward.

actual abstract fun doFinal(): ByteArray

Completes the computation, performing final operations and returning the resultant array of bytes. The Engine is reset afterward.

actual abstract fun doFinal(): ByteArray

Completes the computation, performing final operations and returning the resultant array of bytes. The Engine is reset afterward.

Link copied to clipboard
expect open fun doFinalInto(dest: ByteArray, destOffset: Int)

Called to complete the computation, performing final operations and placing the resultant bytes into the provided dest array starting at index destOffset. The Engine is reset afterward.

actual open fun doFinalInto(dest: ByteArray, destOffset: Int)

Called to complete the computation, performing final operations and placing the resultant bytes into the provided dest array starting at index destOffset. The Engine is reset afterward.

actual open fun doFinalInto(dest: ByteArray, destOffset: Int)

Called to complete the computation, performing final operations and placing the resultant bytes into the provided dest array starting at index destOffset. The Engine is reset afterward.

Link copied to clipboard
expect abstract fun macLength(): Int

The number of bytes the implementation returns when doFinal is called.

actual abstract fun macLength(): Int

The number of bytes the implementation returns when doFinal is called.

actual abstract fun macLength(): Int

The number of bytes the implementation returns when doFinal is called.

Link copied to clipboard
expect abstract fun reset(newKey: ByteArray)

Resets the Engine and will reinitialize it with the provided key.

actual abstract fun reset(newKey: ByteArray)

Resets the Engine and will reinitialize it with the provided key.

actual abstract fun reset(newKey: ByteArray)

Resets the Engine and will reinitialize it with the provided key.

Link copied to clipboard
expect open override fun update(input: ByteArray)
actual open override fun update(input: ByteArray)
actual open override fun update(input: ByteArray)