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

Update bignum_pure.go - Minor edit -> handling zero division in InvModFr #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RDxR10
Copy link

@RDxR10 RDxR10 commented Jan 1, 2023

No description provided.

@RDxR10 RDxR10 changed the title Update bignum_pure.go - Minor edit -> handling zero division in DivModFr Update bignum_pure.go - Minor edit -> handling zero division in InvModFr Jan 1, 2023
@@ -107,8 +108,12 @@ func PowModFr(dst *Fr, a, b *Fr) {
(*big.Int)(dst).Exp((*big.Int)(a), (*big.Int)(b), &_modulus)
}

func InvModFr(dst *Fr, v *Fr) {
func InvModFr(dst *Fr, v *Fr) error {
Copy link
Owner

Choose a reason for hiding this comment

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

The idea is that this function signature matches InvModFr in:

With build tags the performance of different implementations of field-element operations can be compared in benchmarks etc. since a big part of this repository is FFT related code for data-availability-sampling.

And since native divide by zero behaves the same with a panic, and this error return is a breaking API change, I'm a bit hesitant to merge this. What do you use go-kzg for, and what is the motivation for this PR?

Copy link
Author

Choose a reason for hiding this comment

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

I'm just exploring your repo for the sake of learning. This PR is for error handling - might be helpful if used at scale

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

2 participants