DartArgon2State class abstract

State for three Argon2-based algorithms (Argon2d, Argon2i, Argon2id).

If you want to minimize memory allocations, you can re-use the same state for different hash computations.

You can control the number of created isolates with maxIsolates and minBlocksPerSliceForEachIsolate. The default values are usually good.

Constructors

DartArgon2State({required DartArgon2Mode mode, required int parallelism, required int memory, required int iterations, required int hashLength, int? maxIsolates, int? minBlocksPerSliceForEachIsolate, int? blocksPerProcessingChunk, int version, ByteBuffer? buffer})
factory
DartArgon2State.constructor({int version = 19, required DartArgon2Mode mode, required int parallelism, required int memory, required int iterations, required int hashLength, int? maxIsolates, int? minBlocksPerSliceForEachIsolate, int? blocksPerProcessingChunk})

Properties

blockCount int
Number of blocks, which may be different from memory.
latefinal
blocksPerLane int
no setter
blocksPerProcessingChunk int?
final
blocksPerSegment int
no setter
hashCode int
The hash code for this object.
no setterinherited
hashLength int
final
isBufferUsed bool
no setter
isolateCount int
Number of isolates used by the state.
no setter
iterations int
final
maxIsolates int?
final
memory int
final
minBlocksPerSliceForEachIsolate int?
final
mode DartArgon2Mode
final
parallelism int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version int
final

Methods

deriveKeyBytes({required List<int> password, List<int> nonce = const [], List<int> optionalSecret = const [], List<int> associatedData = const []}) Future<List<int>>
Computes result of the given parameters.
deriveKeyBytesFromPrehashingDigest(Uint8List h0) Future<List<int>>
gb(Uint32List data, int a, int b, int c, int d) → void
RFC 9106 function GB(v0,..v3).
getBlock({required int lane, required int slice, required int index}) Uint32List
getByteBuffer() ByteBuffer
initialize({required Uint8List h0}) → void
Initializes the first two blocks of every lane.
iterate() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
permutation(Uint32List data, int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7) → void
RFC 9106 function P(v0,...,v7).
preHashingDigest({required List<int> password, required List<int> nonce, required List<int> optionalSecret, required List<int> associatedData}) Uint8List
Computes the pre-hashing digest.
processBlock({required Uint32List output, required Uint32List input0, required Uint32List input1, required bool isXorred}) → void
Processes a block.
processSegment({required int iteration, required int slice, required int lane}) Future<void>
referredBlockIndex({required int iteration, required int slice, required int lane, required int index, required int j1, required int j2}) → (int, int)
Finds a block using rules describes in the specification.
referredBlockIndexZZ(int j1, int candidatesLength) int
toString() String
A string representation of this object.
inherited
tryReleaseMemory() → void
Releases memory.
variableLengthHash({required Uint8List output, required Uint8List input}) → void
RFC 9106 function H'^T(A).

Operators

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