pub struct WeightNormLinearArgument {
pub g: ProjectivePoint,
pub g_vec: Vec<ProjectivePoint>,
pub h_vec: Vec<ProjectivePoint>,
pub c: Vec<Scalar>,
pub rho: Scalar,
pub mu: Scalar,
}Expand description
Represents public information to be used in weight norm linear argument protocol.
Fields§
§g: ProjectivePoint§g_vec: Vec<ProjectivePoint>§h_vec: Vec<ProjectivePoint>§c: Vec<Scalar>§rho: Scalar§mu: ScalarImplementations§
Source§impl WeightNormLinearArgument
impl WeightNormLinearArgument
Sourcepub fn commit(&self, l: &[Scalar], n: &[Scalar]) -> ProjectivePoint
pub fn commit(&self, l: &[Scalar], n: &[Scalar]) -> ProjectivePoint
Creates weight norm linear argument commitment to vectors l, n:
C = v*g + <h_vec, l> + <g_vec, n>, where v = |n|_{mu}^2 + <c, l>
Sourcepub fn verify(
&self,
commitment: &ProjectivePoint,
t: &mut Transcript,
proof: Proof,
) -> bool
pub fn verify( &self, commitment: &ProjectivePoint, t: &mut Transcript, proof: Proof, ) -> bool
Verifies weight norm linear argument proof wor the provided commitment.
Sourcepub fn prove(
&self,
commitment: &ProjectivePoint,
t: &mut Transcript,
l: Vec<Scalar>,
n: Vec<Scalar>,
) -> Proof
pub fn prove( &self, commitment: &ProjectivePoint, t: &mut Transcript, l: Vec<Scalar>, n: Vec<Scalar>, ) -> Proof
Creates weight norm linear argument proof. commitment argument should be a weight norm
linear argument with respect to l and n private vectors.
Trait Implementations§
Source§impl Clone for WeightNormLinearArgument
impl Clone for WeightNormLinearArgument
Source§fn clone(&self) -> WeightNormLinearArgument
fn clone(&self) -> WeightNormLinearArgument
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 moreAuto Trait Implementations§
impl Freeze for WeightNormLinearArgument
impl RefUnwindSafe for WeightNormLinearArgument
impl Send for WeightNormLinearArgument
impl Sync for WeightNormLinearArgument
impl Unpin for WeightNormLinearArgument
impl UnwindSafe for WeightNormLinearArgument
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