4 ms·
I haven't checked what exactly massscan is doing to randomize the IP and port sequences, but if reduction modulo some runtime constant is that much of a problem
by pbsd 13y ago
I haven't checked what exactly massscan is doing to randomize the IP and port sequences, but if reduction modulo some runtime constant is that much of a problem (according to the Readme at least) perhaps you should consider replacing the modulo and division operations by multiplications?
The canonical reference is Granlund and Montgomery [1]. Luckily, there are ready-made libraries for this, like libdivide [2], which would probably lower the reported 90 cycles into something more palatable (and pipelineable).
[1] http://gmplib.org/~tege/divcnst-pldi94.pdf http://gmplib.org/~tege/divcnst-pldi94.pdf
[2] https://github.com/ridiculousfish/libdivide https://github.com/ridiculousfish/libdivide