BLAKE2b class

Implementation of the BLAKE2b hash function that implements the SerializableHash interface.

BLAKE2b is a cryptographic hash function that produces a fixed-length hash value from input data. This class provides the internal state, buffers, and logic to perform the hashing operation.

Fields:

  • _state: The internal state of the BLAKE2b hash.
  • _buffer: A buffer to hold input data blocks.
  • _bufferLength: The current length of data in the buffer.
  • _ctr: A counter for block processing.
  • _flag: A flag for last node processing.
  • _lastNode: A flag indicating if this is the last node.
  • _finished: A flag indicating if the hashing process is finished.
  • _vtmp: Temporary storage for variable data.
  • _mtmp: Temporary storage for message data.
  • _paddedKey: Padded key for hash initialization.
  • _initialState: The initial state of the BLAKE2b hash.
Implemented types

Constructors

BLAKE2b({int digestLength = 64, Blake2bConfig? config})
Creates a BLAKE2b hash instance with the specified digest length and optional configuration.

Properties

getBlockSize int
The block size used by the hash algorithm.
no setteroverride
getDigestLength int
The length of the digest produced by the hash algorithm.
latefinaloverride-getter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clean() → void
Cleans sensitive data and resets the internal state of the hash function.
override
cleanSavedState(HashState savedState) → void
Cleans and resets a saved hash state, securely erasing sensitive data.
override
digest() List<int>
Returns the final hash digest as a List<int>.
override
finish(List<int> out) BLAKE2b
Finalizes the BLAKE2b hash, producing the hash digest and writing it to the given output List<int>.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() BLAKE2b
Resets the BLAKE2b hash instance to its initial state, clearing all internal data.
override
restoreState(Blake2bState savedState) BLAKE2b
Restores the hash state to a previously saved state object.
override
saveState() Blake2bState
Saves the current state of the BLAKE2b hash function for future restoration.
override
toString() String
A string representation of this object.
inherited
update(List<int> data, {int? length}) BLAKE2b
Updates the BLAKE2b hash with the given data, optionally specifying the data length.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hash(List<int> data, [int digestLength = 64, Blake2bConfig? config]) List<int>
Computes the BLAKE2b hash of the given input data.
override