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

Method add_2

utils/src/randomized_mult_checker.rs:53–58  ·  view source on GitHub ↗

Add a check of the form `p1 * s1 + p2 * s2 = t`. Converts it to `p1 * s1 * r + p2 * s2 * r - t * r = 0` where `r` is the current randomness.

(&mut self, p1: G, s1: &G::ScalarField, p2: G, s2: &G::ScalarField, t: G)

Source from the content-addressed store, hash-verified

51
52 /// Add a check of the form `p1 * s1 + p2 * s2 = t`. Converts it to `p1 * s1 * r + p2 * s2 * r - t * r = 0` where `r` is the current randomness.
53 pub fn add_2(&mut self, p1: G, s1: &G::ScalarField, p2: G, s2: &G::ScalarField, t: G) {
54 self.add(p1, self.current_random * s1);
55 self.add(p2, self.current_random * s2);
56 self.add(t, -self.current_random);
57 self.current_random *= self.random;
58 }
59
60 /// Add a check of the form `p1 * s1 + p2 * s2 + p3 * s3 = t`. Converts it to `p1 * s1 * r + p2 * s2 * r + p3 * s3 * r - t * r = 0` where `r` is the current randomness.
61 pub fn add_3(

Calls 1

addMethod · 0.45

Tested by 2

basicFunction · 0.64
timing_comparisonFunction · 0.64