-
Notifications
You must be signed in to change notification settings - Fork 14
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
results: evaluate against "On Fast Calculation of Addition Chains for Isogeny-Based Cryptography" #56
Comments
For
This is worse by 2 in total length, and worse by a lot on total number of squares. So it could definitely be worthwhile investigating their technique and implementing it. |
I decided to take a look at this. The "smooth isogeny primes" used in the paper have the property that the lower half is mostly '1's, and the upper half appears random. The technique described in Algorithm 4 is essentially:
This procedure is essentially just the dictionary method with a After carefully examining Figure 2 and comparing it to the output of the hybrid dictionary, the difference is entirely localized to the upper half of the prime (which "appears random"). The Unfortunately, as far as I can tell, the paper doesn't actually explain the method it uses for choosing its windows. Section 4.1 and Algorithm 4 are almost entirely preoccupied with explaining its So in the absence of information, I just made up a heuristic that generates windows that more closely resemble the ones shown in Figure 2. I augmented the sliding window technique with two optional rules:
With Nonetheless, these rules result in three improved results:
It makes sense that these techniques would help with P-256 and P-384, because they share a similar binary structure, albeit reversed (long '1' chains in the upper half, and randomness in the lower half). The solution for I made the changes to try out this method in Nik-U@9d14747. If this approach seems reasonable then I can submit a pull request, but I wanted to check with you first to make sure this is an acceptable architecture. The change adds two optional fields to The change adds decomposers with the new techniques into the The only potential clue for how the paper might have generated its windows is reference 17: Improved Techniques for Fast Exponentiation. Section 5.2 contains an "unsigned fractional windows" algorithm that seems to be unlike the currently available decomposers. It is buried under some unintuitive notation, but essentially it boils down to: construct sliding windows with a given max length from LSB to MSB, but if a |
I took a look at reference 17 mentioned at the end of my previous comment. Section 5.2 is essentially a right-to-left sliding window method that allows the window to expand by an extra bit sometimes. For example, with Sadly, this does not explain where the upper windows in Figure 2 of the isogeny prime paper came from, because they certainly do not take this shape (e.g., all windows in question are |
@Nik-U I have a very busy week or two coming up so I don't know if I can give this full attention, but I just wanted to acknowledge your messages and say thanks for your work. These are really great results and I would definitely like to incorporate your work into Your code looks good overall. My only architectural question is whether we should add another decomposer type rather than adding fields to I also found the paper to be lacking clarity on some key points, so I emailed the authors back in May asking if they could share the code. Unfortunately, I didn't get a response. I notice that you seem to be associated with CrySP at Waterloo along with David Jao. Can you ask him for the code? |
No worries! I'll submit the pull request when it's ready, but there's no need for rush processing. 🙂
I agree that a new The new Since submitting the issue, I've also found that implementing a "right-to-left" sliding window method improves the results even further:
So I think that the best way to do this would be:
Adding the right-to-left versions further increases the size of the
I'll see if the code or method is available around here somewhere, though I suspect that the windows might have been hand-generated. |
I've received confirmation that the upper windows for the prime were manually selected, so no algorithm is available. Luckily the two heuristics can get us quite close. |
To add to this discussion: we've recently used addchain to compute addition chains for isogeny primes, but for slightly different shaped primes (CSIDH primes) and slightly different exponents. The preprint is available here: https://eprint.iacr.org/2021/259 Basically, we use primes of the form
In general, we want to find addition chains for exponents that are equivalent to taking the N-th root for N = ell_i for some i, which speeds up cryptographical computations. Now, these exponents It seems to me that similar methods as from this paper should be applicable for fast calculations of addition chains for N-th roots for CSIDH primes! |
Awesome, thanks for the summary @Krijn-math. Apologies if this is already in the paper but I'm curious if you have best known hand-optimized addition chains for these exponents that we can compare against? |
@mmcloughlin We don't have those. For a moment I considered doing so, but the structure of these primes doesn't make that too much fun... |
See how
addchain
performs on target exponents from "On Fast Calculation of Addition Chains for Isogeny-Based Cryptography":http://faculty.eng.fau.edu/azarderakhsh/files/2016/11/Inscrypt2016.pdf
The text was updated successfully, but these errors were encountered: