pub struct Commitment<G: KimchiCurve> {
pub cm: G,
}
Expand description
A commitment that represent a whole data TODO: for now, we consider 1 commitment = 1 contract = 1 data This type may be redundant with other types in Proof-systems
Fields§
§cm: G
Implementations§
Source§impl<G: KimchiCurve> Commitment<G>
impl<G: KimchiCurve> Commitment<G>
Sourcepub fn from_data(srs: &SRS<G>, data: &[G::ScalarField]) -> Commitment<G>
pub fn from_data(srs: &SRS<G>, data: &[G::ScalarField]) -> Commitment<G>
Commit a data
of length smaller than SRS_SIZE
If greater data is provided, anything above SRS_SIZE
is ignored
Sourcepub fn update(&self, srs: &SRS<G>, diff: Diff<G::ScalarField>) -> Commitment<G>
pub fn update(&self, srs: &SRS<G>, diff: Diff<G::ScalarField>) -> Commitment<G>
TODO: This only handle the single commitment version for now This function update the given commitment based on the given diff. The returned commitment correspond to the data for the given commitment updated according to the diff. This function is tested in storage.rs
Trait Implementations§
Source§impl<G: Clone + KimchiCurve> Clone for Commitment<G>
impl<G: Clone + KimchiCurve> Clone for Commitment<G>
Source§fn clone(&self) -> Commitment<G>
fn clone(&self) -> Commitment<G>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<G: Debug + KimchiCurve> Debug for Commitment<G>
impl<G: Debug + KimchiCurve> Debug for Commitment<G>
Source§impl<G: KimchiCurve> From<G> for Commitment<G>
impl<G: KimchiCurve> From<G> for Commitment<G>
Source§impl<G: PartialEq + KimchiCurve> PartialEq for Commitment<G>
impl<G: PartialEq + KimchiCurve> PartialEq for Commitment<G>
impl<G: Eq + KimchiCurve> Eq for Commitment<G>
impl<G: KimchiCurve> StructuralPartialEq for Commitment<G>
Auto Trait Implementations§
impl<G> Freeze for Commitment<G>where
G: Freeze,
impl<G> RefUnwindSafe for Commitment<G>where
G: RefUnwindSafe,
impl<G> Send for Commitment<G>
impl<G> Sync for Commitment<G>
impl<G> Unpin for Commitment<G>where
G: Unpin,
impl<G> UnwindSafe for Commitment<G>where
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more