Native Chan–He collision counting #
This fixed native program first decodes signed Euclidean residue keys, then builds a
histogram and counts ordered collisions. Register setup between the two loops is charged.
For injective input arrays its counter is exactly the existing Chan–He coll.
Main definitions #
Count.program: the composed native residue/histogram program.Count.memory: the complete output memory, including the residue scratch array.
Main results #
Count.exec: execution in at most34n + 5M + 18native instructions.Count.exec_coll: the counter equals the existing mathematical collision count.Count.memory_before: cells below the two workspace blocks retain their contents.
References #
Residue routine registers occupy the first sixteen registers.
Instances For
Histogram registers occupy registers sixteen through twenty-six.
Instances For
Encoded integer input base.
Instances For
Residue scratch base.
Instances For
Number of input values.
Instances For
Encoded positive modulus.
Instances For
Histogram destination base.
Instances For
Output collision count, an ordinary unsigned word.
Instances For
Histogram input base register.
Instances For
Histogram output base register.
Instances For
Histogram length register.
Instances For
Histogram modulus register.
Instances For
Histogram constant register, also used to decode the encoded modulus.
Instances For
Set up the histogram parameters, explicitly decoding the positive modulus.
Instances For
A single finite native program, independent of input length, modulus and word width.
Instances For
Complete native collision counting, including residue computation, clearing the histogram and register setup. Input, scratch and histogram blocks occur in that order and are disjoint. The final halt is excluded. Fit hypotheses are local; a caller must derive them from its input and width contract.
For an injective integer array, the composed program returns exactly the collision count used by the existing Chan–He prime searches.