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

chore: Initial impl for KZG10 #234

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

chore: Initial impl for KZG10 #234

wants to merge 3 commits into from

Conversation

kevaundray
Copy link
Contributor

This provides an initial impl for some of the methods needed in Deneb, however we compute the quotient commitment using the "conventional" strategy of commiting to the quotient polynomial in monomial form.

@kevaundray
Copy link
Contributor Author

This is related to #162 -- one can use this branch to check that the difference in using monomial form is actually negligible while it results in much simpler code

Comment on lines 21 to 31
// Bit reverse the polynomial and interpolate it.
//
// The bit-reversal is an artifact of a feature we want to maintain
// when we use FK20.
let mut poly_lagrange = polynomial_lagrange.to_vec();
reverse_bit_order(&mut poly_lagrange);
let polynomial_coeff = domain.ifft_scalars(poly_lagrange);

let quotient_poly = divide_by_linear(&polynomial_coeff, input_point);
let quotient_commitment = commit_key.commit_g1(quotient_poly.as_slice());
let claimed_evaluation = poly_eval(&polynomial_coeff, &input_point);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of these methods are actually new -- they are all a part of eip7594 specs, so in a way this does not add any new complexity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • divide_by_linear is a simpler version of divide_polynomialcoeff where b is a linear polynomial
  • poly_eval is evaluate_polynomial_coeff
  • commit_g1 is g1_lincomb

blst = { version = "0.3", default-features = false }
blst = { version = "0.3", default-features = false, features = ["no-threads"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would usually be controlled by the threadpool, but since its not been integrated, I just turn off all threads

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.

1 participant