Skip to content

Commit

Permalink
20 hours of my life ...smh
Browse files Browse the repository at this point in the history
  • Loading branch information
PatStiles committed Feb 5, 2024
1 parent d3f71dd commit 3d0541b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/subprotocols/zeromorph/zeromorph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::utils::transcript::ProofTranscript;
use ark_bn254::Bn254;
use ark_ec::{pairing::Pairing, AffineRepr, CurveGroup};
use ark_ff::{batch_inversion, Field};
use ark_serialize::Valid;
use ark_std::{iterable::Iterable, One, Zero};
use itertools::Itertools;
use lazy_static::lazy_static;
Expand Down Expand Up @@ -491,10 +492,9 @@ impl<P: Pairing> ZMPolynomialCommitmentScheme for Zeromorph<P> {
let Zeta_z_com = <P::G1 as VariableBaseMSM>::msm(&bases, &scalars).unwrap();

// e(pi, [tau]_2 - x * [1]_2) == e(C_{\zeta,Z}, [X^(N_max - 2^n - 1)]_2) <==> e(C_{\zeta,Z} - x * pi, [X^{N_max - 2^n - 1}]_2) * e(-pi, [tau_2]) == 1
let lhs = P::pairing(pi, vk.tau_2.into_group() - (vk.g2 * x_challenge));
let rhs = P::pairing(Zeta_z_com, vk.tau_N_max_sub_2_N);
assert!(lhs == rhs);
Ok(())
let res = P::multi_pairing(&[pi, Zeta_z_com], &[(vk.tau_2.into_group() - (vk.g2 * x_challenge)),vk.tau_N_max_sub_2_N.into_group()]);
// From what I am aware this verifies that the product of the pairing is equal to one
Ok(res.check().unwrap())
}
}

Expand Down

0 comments on commit 3d0541b

Please sign in to comment.