Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Possible overflow in r1csqap/LagrangeInterpolation #21

Open
ShuangWu121 opened this issue Jan 12, 2021 · 0 comments
Open

Possible overflow in r1csqap/LagrangeInterpolation #21

ShuangWu121 opened this issue Jan 12, 2021 · 0 comments

Comments

@ShuangWu121
Copy link

The function "NewPolZeroAt" in r1csqap.go, which is used by function "LagrangeInterpolation"

has the following code

fac := 1
	for i := 1; i < totalPoints+1; i++ {
		if i != pointPos {
			fac = fac * (pointPos - i)
		}
	}
facBig := big.NewInt(int64(fac))

I am facing a problem that 'fac' can be larger than int64, which make the algorithm generate wrong polynomial. Has anyone else faced this problem as well?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant