-
Notifications
You must be signed in to change notification settings - Fork 22
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
chore: Use monomial form when computing the quotient #98
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package goethkzg | ||
|
||
import ( | ||
"github.com/crate-crypto/go-eth-kzg/internal/domain" | ||
"github.com/crate-crypto/go-eth-kzg/internal/kzg" | ||
) | ||
|
||
|
@@ -62,8 +63,11 @@ func (c *Context) ComputeBlobKZGProof(blob *Blob, blobCommitment KZGCommitment, | |
// 2. Compute Fiat-Shamir challenge | ||
evaluationChallenge := computeChallenge(blob, blobCommitment) | ||
|
||
domain.BitReverse(polynomial) | ||
polyCoeff := c.domain.IfftFr(polynomial) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This additional IFFT costs 1ms which is not that much compared to the MSM |
||
|
||
// 3. Create opening proof | ||
openingProof, err := kzg.Open(c.domain, polynomial, evaluationChallenge, c.commitKeyLagrange, numGoRoutines) | ||
openingProof, err := kzg.Open(c.domain, polyCoeff, evaluationChallenge, c.commitKeyMonomial, numGoRoutines) | ||
if err != nil { | ||
return KZGProof{}, err | ||
} | ||
|
@@ -95,8 +99,11 @@ func (c *Context) ComputeKZGProof(blob *Blob, inputPointBytes Scalar, numGoRouti | |
return KZGProof{}, [32]byte{}, err | ||
} | ||
|
||
domain.BitReverse(polynomial) | ||
polyCoeff := c.domain.IfftFr(polynomial) | ||
|
||
// 2. Create opening proof | ||
openingProof, err := kzg.Open(c.domain, polynomial, inputPoint, c.commitKeyLagrange, numGoRoutines) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to get rid of commitKeyLagrange entirely, if we can stomach the 1ms ifft |
||
openingProof, err := kzg.Open(c.domain, polyCoeff, inputPoint, c.commitKeyMonomial, numGoRoutines) | ||
if err != nil { | ||
return KZGProof{}, [32]byte{}, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not deleted the code, we no longer need but this is comparatively simpler than what we were doing before