1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
mod proverkey;
mod verifierkey;
pub use proverkey::ProverKey;
pub use verifierkey::VerifierKey;
use dusk_bls12_381::Scalar;
fn delta(f: Scalar) -> Scalar {
let f_1 = f - Scalar::one();
let f_2 = f - Scalar::from(2);
let f_3 = f - Scalar::from(3);
f * f_1 * f_2 * f_3
}
#[allow(non_snake_case)]
fn delta_xor_and(a: &Scalar, b: &Scalar, w: &Scalar, c: &Scalar, q_c: &Scalar) -> Scalar {
let nine = Scalar::from(9);
let two = Scalar::from(2);
let three = Scalar::from(3);
let four = Scalar::from(4);
let eighteen = Scalar::from(18);
let eighty_one = Scalar::from(81);
let eighty_three = Scalar::from(83);
let F = w
* (w * (four * w - eighteen * (a + b) + eighty_one) + eighteen * (a.square() + b.square())
- eighty_one * (a + b)
+ eighty_three);
let E = three * (a + b + c) - (two * F);
let B = q_c * ((nine * c) - three * (a + b));
B + E
}