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

Fuzz Fix - Hash-To-Curve - Isogeny EC add non-fully-reduced input #250

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Jul 2, 2023

Skipping the final substraction in this codepath (only taken for EC add on isogeny in SSWU hash-to-curve):

HHH_or_Mpre.prod(a, b, true) # HHH or X₁²

is incorrect as HHH_or_Mpre is later used in field addition/substraction and so need fully reduced Montgomery representation.

Furthermore we fix a similar bug when the curve has a coefficient a=-3 (we have no such curve fully implemented though P256 and other NIST curves all have a=-3).

Lastly we accelerate BLS12-381 hashToG2 by enabling mulCheckSparse

We also change the notation of intermediate point from P to Q to be in line with the spec documentation
image

@mratsim mratsim merged commit d69c7bf into master Jul 3, 2023
12 checks passed
@mratsim mratsim deleted the fuzz-fail-2-h2c branch July 3, 2023 04:57
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.

None yet

1 participant