pub fn init_pairs_instruction(
    public_inputs: &[ark_ff::Fp256<ark_ed_on_bn254::FqParameters>],
    i_1_range: &mut Vec<u8>,
    x_1_range: &mut Vec<u8>,
    i_2_range: &mut Vec<u8>,
    x_2_range: &mut Vec<u8>,
    i_3_range: &mut Vec<u8>,
    x_3_range: &mut Vec<u8>,
    i_4_range: &mut Vec<u8>,
    x_4_range: &mut Vec<u8>,
    i_5_range: &mut Vec<u8>,
    x_5_range: &mut Vec<u8>,
    i_6_range: &mut Vec<u8>,
    x_6_range: &mut Vec<u8>,
    i_7_range: &mut Vec<u8>,
    x_7_range: &mut Vec<u8>,
    g_ic_x_range: &mut Vec<u8>,
    g_ic_y_range: &mut Vec<u8>,
    g_ic_z_range: &mut Vec<u8>,
) -> Result<(), ProgramError> {
    // Parses vk_gamma_abc_g1 from hard-coded file.
    // Should have 8 items if 7 public inputs are passed in since [0] will be used to initialize g_ic.
    // Called once.
    let pvk_vk_gamma_abc_g1 = vec![
        get_gamma_abc_g1_0(),
        get_gamma_abc_g1_1(),
        get_gamma_abc_g1_2(),
        get_gamma_abc_g1_3(),
        get_gamma_abc_g1_4(),
        get_gamma_abc_g1_5(),
        get_gamma_abc_g1_6(),
        get_gamma_abc_g1_7(),
    ];
    if (public_inputs.len() + 1) != pvk_vk_gamma_abc_g1.len() {
        msg!("Incompatible Verifying Key");
        return Err(ProgramError::InvalidInstructionData);
    }

    // inits g_ic into range.
    let g_ic = pvk_vk_gamma_abc_g1[0].into_projective();

    parse_group_projective_to_bytes_254(g_ic, g_ic_x_range, g_ic_y_range, g_ic_z_range);

    // Creates and parses i,x pairs into ranges.
    let mut i_vec: Vec<ark_ff::Fp256<ark_ed_on_bn254::FqParameters>> = vec![];
    let mut x_vec: Vec<ark_ec::short_weierstrass_jacobian::GroupAffine<ark_bn254::g1::Parameters>> =
        vec![];

    for (i, x) in public_inputs.iter().zip(pvk_vk_gamma_abc_g1.iter().skip(1)) {
        i_vec.push(*i);
        x_vec.push(*x);
    }

    parse_fp256_ed_to_bytes(i_vec[0], i_1_range);
    parse_fp256_ed_to_bytes(i_vec[1], i_2_range);
    parse_fp256_ed_to_bytes(i_vec[2], i_3_range);
    parse_fp256_ed_to_bytes(i_vec[3], i_4_range);
    parse_fp256_ed_to_bytes(i_vec[4], i_5_range);
    parse_fp256_ed_to_bytes(i_vec[5], i_6_range);
    parse_fp256_ed_to_bytes(i_vec[6], i_7_range);

    parse_x_group_affine_to_bytes(x_vec[0], x_1_range);
    parse_x_group_affine_to_bytes(x_vec[1], x_2_range);
    parse_x_group_affine_to_bytes(x_vec[2], x_3_range);
    parse_x_group_affine_to_bytes(x_vec[3], x_4_range);

    parse_x_group_affine_to_bytes(x_vec[4], x_5_range);
    parse_x_group_affine_to_bytes(x_vec[5], x_6_range);
    parse_x_group_affine_to_bytes(x_vec[6], x_7_range);
    Ok(())
}
// Initializes all i,x pairs. 7 pairs for 7 public inputs.
// Creates all i,x pairs once, then stores them in specified ranges.
// Other ix can then parse the i,x pair they need. Storing all pairs allows us to replicate
// the loop behavior inside the library's implementation:
// https://docs.rs/ark-groth16/0.3.0/src/ark_groth16/verifier.rs.html#31-33
Initializes all i,x pairs. 7 pairs for 7 public inputs.
Creates all i,x pairs once, then stores them in specified ranges.
Other ix can then parse the i,x pair they need.
Initializes all i x pairs . 7 pairs for 7 public inputs . Creates all i x pairs once then stores them in specified ranges . Other ix can then parse the i x pair they need .
pub fn init_pairs_instruction(
    public_inputs: &[ark_ff::Fp256<ark_ed_on_bn254::FqParameters>],
    i_1_range: &mut Vec<u8>,
    x_1_range: &mut Vec<u8>,
    i_2_range: &mut Vec<u8>,
    x_2_range: &mut Vec<u8>,
    i_3_range: &mut Vec<u8>,
    x_3_range: &mut Vec<u8>,
    i_4_range: &mut Vec<u8>,
    x_4_range: &mut Vec<u8>,
    i_5_range: &mut Vec<u8>,
    x_5_range: &mut Vec<u8>,
    i_6_range: &mut Vec<u8>,
    x_6_range: &mut Vec<u8>,
    i_7_range: &mut Vec<u8>,
    x_7_range: &mut Vec<u8>,
    g_ic_x_range: &mut Vec<u8>,
    g_ic_y_range: &mut Vec<u8>,
    g_ic_z_range: &mut Vec<u8>,
) -> Result<(), ProgramError> {
    // Parses vk_gamma_abc_g1 from hard-coded file.
    // Should have 8 items if 7 public inputs are passed in since [0] will be used to initialize g_ic.
    // Called once.
    let pvk_vk_gamma_abc_g1 = vec![
        get_gamma_abc_g1_0(),
        get_gamma_abc_g1_1(),
        get_gamma_abc_g1_2(),
        get_gamma_abc_g1_3(),
        get_gamma_abc_g1_4(),
        get_gamma_abc_g1_5(),
        get_gamma_abc_g1_6(),
        get_gamma_abc_g1_7(),
    ];
    if (public_inputs.len() + 1) != pvk_vk_gamma_abc_g1.len() {
        msg!("Incompatible Verifying Key");
        return Err(ProgramError::InvalidInstructionData);
    }
    // inits g_ic into range.
    let g_ic = pvk_vk_gamma_abc_g1[0].into_projective();
    parse_group_projective_to_bytes_254(g_ic, g_ic_x_range, g_ic_y_range, g_ic_z_range);
    // Creates and parses i,x pairs into ranges.
    let mut i_vec: Vec<ark_ff::Fp256<ark_ed_on_bn254::FqParameters>> = vec![];
    let mut x_vec: Vec<ark_ec::short_weierstrass_jacobian::GroupAffine<ark_bn254::g1::Parameters>> =
        vec![];
    for (i, x) in public_inputs.iter().zip(pvk_vk_gamma_abc_g1.iter().skip(1)) {
        i_vec.push(*i);
        x_vec.push(*x);
    }
    parse_fp256_ed_to_bytes(i_vec[0], i_1_range);
    parse_fp256_ed_to_bytes(i_vec[1], i_2_range);
    parse_fp256_ed_to_bytes(i_vec[2], i_3_range);
    parse_fp256_ed_to_bytes(i_vec[3], i_4_range);
    parse_fp256_ed_to_bytes(i_vec[4], i_5_range);
    parse_fp256_ed_to_bytes(i_vec[5], i_6_range);
    parse_fp256_ed_to_bytes(i_vec[6], i_7_range);
    parse_x_group_affine_to_bytes(x_vec[0], x_1_range);
    parse_x_group_affine_to_bytes(x_vec[1], x_2_range);
    parse_x_group_affine_to_bytes(x_vec[2], x_3_range);
    parse_x_group_affine_to_bytes(x_vec[3], x_4_range);
    parse_x_group_affine_to_bytes(x_vec[4], x_5_range);
    parse_x_group_affine_to_bytes(x_vec[5], x_6_range);
    parse_x_group_affine_to_bytes(x_vec[6], x_7_range);
    Ok(())
}
pub fn init_pairs_instruction ( public_inputs : & [ ark_ff :: Fp256 < ark_ed_on_bn254 :: FqParameters > ] , i_1_range : & mut Vec < u8 > , x_1_range : & mut Vec < u8 > , i_2_range : & mut Vec < u8 > , x_2_range : & mut Vec < u8 > , i_3_range : & mut Vec < u8 > , x_3_range : & mut Vec < u8 > , i_4_range : & mut Vec < u8 > , x_4_range : & mut Vec < u8 > , i_5_range : & mut Vec < u8 > , x_5_range : & mut Vec < u8 > , i_6_range : & mut Vec < u8 > , x_6_range : & mut Vec < u8 > , i_7_range : & mut Vec < u8 > , x_7_range : & mut Vec < u8 > , g_ic_x_range : & mut Vec < u8 > , g_ic_y_range : & mut Vec < u8 > , g_ic_z_range : & mut Vec < u8 > , ) -> Result < ( ) , ProgramError > { // Parses vk_gamma_abc_g1 from hard-coded file. // Should have 8 items if 7 public inputs are passed in since [0] will be used to initialize g_ic. // Called once. let pvk_vk_gamma_abc_g1 = vec ! [ get_gamma_abc_g1_0 ( ) get_gamma_abc_g1_1 ( ) get_gamma_abc_g1_2 ( ) get_gamma_abc_g1_3 ( ) get_gamma_abc_g1_4 ( ) get_gamma_abc_g1_5 ( ) get_gamma_abc_g1_6 ( ) get_gamma_abc_g1_7 ( ) ] ; if ( public_inputs . len ( ) + 1 ) != pvk_vk_gamma_abc_g1 . len ( ) { msg ! ( " " ) ; return Err ( ProgramError :: InvalidInstructionData ) ; } // inits g_ic into range. let g_ic = pvk_vk_gamma_abc_g1 [ 0 ] . into_projective ( ) ; parse_group_projective_to_bytes_254 ( g_ic , g_ic_x_range , g_ic_y_range , g_ic_z_range ) ; // Creates and parses i,x pairs into ranges. let mut i_vec : Vec < ark_ff :: Fp256 < ark_ed_on_bn254 :: FqParameters > > = vec ! [ ] ; let mut x_vec : Vec < ark_ec :: short_weierstrass_jacobian :: GroupAffine < ark_bn254 :: g1 :: Parameters > > = vec ! [ ] ; for ( i , x ) in public_inputs . iter ( ) . zip ( pvk_vk_gamma_abc_g1 . iter ( ) . skip ( 1 ) ) { i_vec . push ( * i ) ; x_vec . push ( * x ) ; } parse_fp256_ed_to_bytes ( i_vec [ 0 ] , i_1_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 1 ] , i_2_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 2 ] , i_3_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 3 ] , i_4_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 4 ] , i_5_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 5 ] , i_6_range ) ; parse_fp256_ed_to_bytes ( i_vec [ 6 ] , i_7_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 0 ] , x_1_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 1 ] , x_2_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 2 ] , x_3_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 3 ] , x_4_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 4 ] , x_5_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 5 ] , x_6_range ) ; parse_x_group_affine_to_bytes ( x_vec [ 6 ] , x_7_range ) ; Ok ( ( ) ) }
Initializes all i,x pairs.
Initializes all i x pairs .
public_inputs
&[ark_ff::Fp256<ark_ed_on_bn254::FqParameters>]
i_1_range
&mut Vec<u8>
x_1_range
&mut Vec<u8>
i_2_range
&mut Vec<u8>
x_2_range
&mut Vec<u8>
i_3_range
&mut Vec<u8>
x_3_range
&mut Vec<u8>
i_4_range
&mut Vec<u8>
x_4_range
&mut Vec<u8>
i_5_range
&mut Vec<u8>
x_5_range
&mut Vec<u8>
i_6_range
&mut Vec<u8>
x_6_range
&mut Vec<u8>
i_7_range
&mut Vec<u8>
x_7_range
&mut Vec<u8>
g_ic_x_range
&mut Vec<u8>
g_ic_y_range
&mut Vec<u8>
g_ic_z_range
&mut Vec<u8>