Cha Cha Engine.Advance Block Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Advance | Advances the engine state to the next block (next entropy window). |
| Advance | Advances the counter by the specified number of blocks. |
AdvanceBlock
Remarks
This method performs the block transition function, moving the engine to a new block of output values. After this call, Output(Int32) will return values from the new block.
The block transition is algorithm-specific and deterministic. Successive calls to AdvanceBlock() move through the generator's sequence in a reproducible manner.
AdvanceBlock(UInt64)
public void AdvanceBlock(
ulong blockCount
)Parameters
- blockCount UInt64
- The number of blocks to advance. Each block corresponds to BlockLength output values.
Implements
ICounterBased<T>.AdvanceBlock(UInt64)Remarks
This method increments the counter by blockCount in counter space, performing proper carry propagation for multi-word counters. This provides O(1) skip-ahead capability.
This operation is an overload of the single-step AdvanceBlock() method, allowing efficient advancement by multiple blocks.
Consistency:
After calling AdvanceBlock(UInt64), implementations may either regenerate the block (leaving the engine consistent) or leave the block stale (leaving the engine inconsistent). Callers should assume the engine is inconsistent after this call and invoke GenerateBlock() before using output methods.