[−][src]Struct dusk_plonk::commitment_scheme::kzg10::key::CommitKey
CommitKey is used to commit to a polynomial which is bounded by the max_degree.
Fields
powers_of_g: Vec<G1Affine>
Group elements of the form { \beta^i G }
, where i
ranges from 0 to degree
.
Implementations
impl CommitKey
[src][−]
pub fn max_degree(&self) -> usize
[src][−]
Returns the maximum degree polynomial that you can commit to.
pub fn truncate(&self, truncated_degree: usize) -> Result<CommitKey, Error>
[src][−]
Truncates the commit key to a lower max degree. Returns an error if the truncated degree is zero or if the truncated degree is larger than the max degree of the commit key.
pub fn commit(&self, polynomial: &Polynomial) -> Result<Commitment, Error>
[src][−]
Commits to a polynomial returning the corresponding Commitment
.
Returns an error if the polynomial's degree is more than the max degree of the commit key.
pub fn compute_single_witness(
&self,
polynomial: &Polynomial,
point: &Scalar
) -> Polynomial
[src][−]
&self,
polynomial: &Polynomial,
point: &Scalar
) -> Polynomial
For a given polynomial p
and a point z
, compute the witness
for p(z) using Ruffini's method for simplicity.
The Witness is the quotient of f(x) - f(z) / x-z.
However we note that the quotient polynomial is invariant under the value f(z)
ie. only the remainder changes. We can therefore compute the witness as f(x) / x - z
and only use the remainder term f(z) during verification.
pub fn open_single(
&self,
polynomial: &Polynomial,
value: &Scalar,
point: &Scalar
) -> Result<Proof, Error>
[src][−]
&self,
polynomial: &Polynomial,
value: &Scalar,
point: &Scalar
) -> Result<Proof, Error>
Creates an opening proof that a polynomial p
was correctly evaluated at p(z) and produced the value
v
. ie v = p(z).
Returns an error if the polynomials degree is too large.
pub fn open_multiple(
&self,
polynomials: &[Polynomial],
evaluations: Vec<Scalar>,
point: &Scalar,
transcript: &mut Transcript
) -> Result<AggregateProof, Error>
[src][−]
&self,
polynomials: &[Polynomial],
evaluations: Vec<Scalar>,
point: &Scalar,
transcript: &mut Transcript
) -> Result<AggregateProof, Error>
Creates an opening proof that multiple polynomials were evaluated at the same point and that each evaluation produced the correct evaluation point. Returns an error if any of the polynomial's degrees are too large.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CommitKey
impl Send for CommitKey
impl Sync for CommitKey
impl Unpin for CommitKey
impl UnwindSafe for CommitKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,