switch to ternary search for zeta #170
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been seeing some issues with local minima in the zeta search: I was looking at the parameters from this paper, and saw (excuse formatting):
i.e., switching MITM on increases the complexity, which I don't think can ever be true.
I tracked the issue down to there being local minima in zeta, and the binary search is just heading for the wrong one. I experimented a bit with neighborhoods, but didn't have much success, partly because I don't have a great sense for what the curve with zeta looks like for these massive parameters. Additionally, these two zeta are 2^14.5 apart.
Instead I implemented a different hot fix, switching to a ternary search for this loop only. This isn't an ideal fix, as
schemes.Kyber512.updated(Xs=ND.SparseTernary(16))
in the examples, it finds an attack that is maybe 5 bits more complex than current binary search.I tried to avoid both of these by only using the ternary search when n >= 2 ** 15, since 1. it's already slow then 2. I didn't see any parameters in this range where the ternary search finds a worse attack
Now with the parameters above I find
i.e. about 17 bits better.
Let me know what you think