Charged calls to Chan–He collision counting #
The prime searches keep their parameters outside the counting workspace. Each of the three set arrays has a fixed pair of base/length registers and its own result register. This module charges argument setup and result delivery as well as the complete native counting routine.
Main definitions #
CountCall.program: a counting call on one of the three input arrays.
Main results #
CountCall.exec: exact collision count, memory frame and preserved caller registers.
Counting workspace in a larger, fixed register file.
Length register for the selected set.
Base register for the selected set.
Residue scratch base.
Histogram base.
Encoded positive modulus.
Collision-count output register for the selected set.
Counting input base register.
Counting scratch base register.
Counting input length register.
Counting encoded-modulus register.
Counting histogram base register.
Counting result register.
Five runtime register copies deliver the counting arguments.
A complete native count call, including argument and result copies.
A native count call costs 34n+5M+24, including five argument copies and one result copy.
The mathematical input is an injective array enumeration, as required by the existing set-based
Chan–He collision count. All registers outside the workspace, except its chosen result, survive.