-
Notifications
You must be signed in to change notification settings - Fork 181
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
[Optim] Square root on Fp2 #2
Comments
Just a note that feedback is appreciated and is being considered. Thanks! |
Diving into the code here: Lines 86 to 179 in 5c41509
We have roughly currently:
Adj-Hendriquez paper would require:
Hence your implementation seems to do 33% less operations on paper. |
As it turns out, it's possible to omit all the checks and leave just a pair of sqrt_fp calls. This amounts to ~2.5x improvement for sqrt_fp2 itself, and >40% for hash-to-[g2-]curve. See new sqrt.c:-) |
Is the addition chain to exponentiate by a^((p^2-9)/16) faster than the method mentioned in
Adj, G. and F. Rodriguez-Henriquez, "Square Root Computation over Even Extension Fields",
DOI 10.1109/TC.2013.145, pages 2829-2841, In IEEE
Transactions on Computers. vol 63 issue 11, November 2014,
https://doi.org/10.1109/TC.2013.145.
https://eprint.iacr.org/2012/685.pdf
In Nim, assuming we have
sqrt_invsqrt
which returns both the sqrt and inverse sqrt on FpThe text was updated successfully, but these errors were encountered: