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

Reject zero inputs in bls_modular_inverse() #3299

Merged
merged 2 commits into from
Mar 20, 2023
Merged

Conversation

asn-d6
Copy link
Contributor

@asn-d6 asn-d6 commented Mar 16, 2023

Zero doesn't have a multiplicative inverse and having bls_modular_inverse() return zero upon receiving zero was a convention.

We then noticed that implementing that convention in blst was not straightforward, so we decided to revisit it.

Given that there is no point in the spec where bls_modular_inverse() is called with zero as its input, and given that from a protocol point of view that convention doesn't make much sense, we decided to instead reject zero as inputs to bls_modular_inverse(). This PR makes it so.

@asn-d6
Copy link
Contributor Author

asn-d6 commented Mar 16, 2023

I will add a unittest for this tomorrow as well.

@asn-d6 asn-d6 force-pushed the inv_no_inputs branch 3 times, most recently from 77443a2 to f8bd0cf Compare March 17, 2023 10:16
@ppopth
Copy link
Member

ppopth commented Mar 17, 2023

LGTM!

@asn-d6 asn-d6 requested review from dankrad and hwwhww March 17, 2023 12:54
Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hwwhww hwwhww merged commit 334601c into ethereum:dev Mar 20, 2023
@hwwhww hwwhww added the Deneb was called: eip-4844 label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deneb was called: eip-4844
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants