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

FourQ ecc_mul_double implementation #495

Closed
wants to merge 3 commits into from

Conversation

LINCKODE
Copy link

Implemented ecc_mul_double as DoubleScalarMult in curve.go .
Please advise me if the code does not adhere to project standards, I'm somewhat new to Go. 😅

@armfazh
Copy link
Contributor

armfazh commented Apr 24, 2024

Hi @LINCKODE what is the use case for this function? and usually, the operation kG+lP is performed using a better algorithm than performing kG, lP, and then add these points.

@LINCKODE
Copy link
Author

Thanks for the reply!
This function is required for verifying Schnorr signatures over FourQ.
You can see how it is being used in FourQLib's SchnorrQ_Verify function.
I see that FourQLib defines another way of performing this calculation, but that requires the use of endomorphisms, which I am not familiar with.
If you know of another way of doing this, I'd be happy to give it a go.

@armfazh
Copy link
Contributor

armfazh commented Apr 24, 2024

See the implementation of CombinedMult for the P384 curve.
https://github.com/cloudflare/circl/blob/main/ecc/p384/p384opt.go#L135

This method is generic and agnostic to the use of endomorphisms.

@LINCKODE
Copy link
Author

That looks interesting, doing both multiplications in one loop.
Ill have to look at this a bit closer to fully understand how it works, then I'll try to replicate it for FourQ.
Thanks for the hint!

@armfazh
Copy link
Contributor

armfazh commented Apr 26, 2024

I'm gonna close this PR to keep our list short, happy to review when you push a new PR with the other algorithm.

@armfazh armfazh closed this Apr 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants