Test function to check if Omega is generated correctly.
(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
element: &G::ScalarField,
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>,
)
| 714 | #[cfg(test)] |
| 715 | /// Test function to check if Omega is generated correctly. |
| 716 | pub(crate) fn check( |
| 717 | additions: &[G::ScalarField], |
| 718 | removals: &[G::ScalarField], |
| 719 | element: &G::ScalarField, |
| 720 | old_accumulator: &G, |
| 721 | sk: &SecretKey<G::ScalarField>, |
| 722 | ) { |
| 723 | use ark_ff::Field; |
| 724 | |
| 725 | let v_AD = Poly_v_AD::eval_direct(additions, removals, &sk.0, element); |
| 726 | let d_D_inv = Poly_d::eval_direct(removals, element).inverse().unwrap(); |
| 727 | |
| 728 | let mut V_prime = old_accumulator.into_group(); |
| 729 | V_prime *= v_AD * d_D_inv; |
| 730 | |
| 731 | let omega = Self::new(additions, removals, old_accumulator, sk); |
| 732 | // <powers_of_y, omega> * 1/d_D(x) |
| 733 | let y_omega_ip = omega.evaluate(element, &d_D_inv); |
| 734 | |
| 735 | assert_eq!(V_prime, y_omega_ip); |
| 736 | } |
| 737 | |
| 738 | #[cfg(test)] |
| 739 | /// Test function to check if generated correctly. |