Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure in permutation generator #15

Open
shevek opened this issue Oct 3, 2013 · 0 comments
Open

failure in permutation generator #15

shevek opened this issue Oct 3, 2013 · 0 comments

Comments

@shevek
Copy link

shevek commented Oct 3, 2013

https://github.com/robertdavidgraham/masscan/blob/master/src/rand-blackrock.c

FYI the error is that % rounds towards zero, and does not generate nonnegative equivalence classes.

If you rewrite using e.g. LongMath.mod() as per http://code.google.com/p/guava-libraries/wiki/MathExplained then the bidirectional verification code you have works.

If you don't, then you're basically doing many extra rounds sometimes because you generate a negative number which is masked because you compute with unsigned.

I have ported your code to Java, and it now passes the bidirectional verifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant