MCPcopy Create free account
hub / github.com/docknetwork/crypto / is_valid

Method is_valid

compressed_sigma/src/compressed_linear_form.rs:217–236  ·  view source on GitHub ↗

Validate the proof of knowledge in the non-recursive manner. This will delay scalar multiplications till the end similar to whats described in the Bulletproofs paper, thus is faster than the recursive version above. The key idea is that the verifier knows both `A` and `B` at the start and thus he knows all the immediate challenges `c` also at the start. Thus the verifier can create the final g' an

(
        &self,
        g: &[G],
        h: &G,
        k: &G,
        P: &G,
        y: &G::ScalarField,
        linear_form: &L,
        A_hat: &G,
        t: &G::ScalarField,
        c_0: &G::Scal

Source from the content-addressed store, hash-verified

215 /// all the immediate challenges `c` also at the start. Thus the verifier can create the final g' and Q
216 /// in a single multi-scalar multiplication
217 pub fn is_valid<D: Digest, L: LinearForm<G::ScalarField>>(
218 &self,
219 g: &[G],
220 h: &G,
221 k: &G,
222 P: &G,
223 y: &G::ScalarField,
224 linear_form: &L,
225 A_hat: &G,
226 t: &G::ScalarField,
227 c_0: &G::ScalarField,
228 c_1: &G::ScalarField,
229 ) -> Result<(), CompSigmaError> {
230 self.check_sizes(g, linear_form)?;
231
232 let (g_hat, L_tilde) =
233 prepare_generators_and_linear_form_for_compression::<G, L>(g, h, linear_form, c_1);
234 let Q = calculate_Q(k, P, y, A_hat, t, c_0, c_1);
235 self.validate_compressed::<D, L>(Q, g_hat, L_tilde, k)
236 }
237
238 pub fn recursively_validate_compressed<D: Digest, L: LinearForm<G::ScalarField>>(
239 &self,

Callers

nothing calls this directly

Calls 2

calculate_QFunction · 0.70
check_sizesMethod · 0.45

Tested by

no test coverage detected