pub fn oods_consistency_check(ctx: & mut Vec<Uint256>, registry: & HashMap<Uint256, bool>) {
    //Checks that information on memory pages (used from data by prover) is consistent with z, alpha values 
    //TODO: DO we even need it? Uncomment when fixed//memory_fact_registry::verify_memory_page_facts(ctx, registry);

    let oods_point = ctx[map::MM_OODS_POINT].clone();

    //TODO: Test when remix stops tweaking
    println!("oods_point: {}", oods_point);

    // The number of copies in the pedersen hash periodic columns is
    // nSteps / PEDERSEN_BUILTIN_RATIO / PEDERSEN_BUILTIN_REPETITIONS
    let n_penderson_hash_copies = uint256_ops::safe_div(
       &prime_field::fpow(&uint256_ops::get_uint256("2"), &ctx[map::MM_LOG_N_STEPS]), 
        &uint256_ops::from_usize(stark_params::PEDERSEN_BUILTIN_RATIO * stark_params::PEDERSEN_BUILTIN_REPETITIONS)
    );
    let z_point_pow_penderson = prime_field::fpow( &oods_point, &n_penderson_hash_copies );

    ctx[map::MM_PERIODIC_COLUMN__PEDERSEN__POINTS__X] = penderson_hash_x::compute(z_point_pow_penderson.clone());
    ctx[map::MM_PERIODIC_COLUMN__PEDERSEN__POINTS__Y] = penderson_hash_y::compute(z_point_pow_penderson.clone());

    // The number of copies in the ECDSA signature periodic columns is
    // nSteps / ECDSA_BUILTIN_RATIO / ECDSA_BUILTIN_REPETITIONS
    let n_ecdsa_signature_copy = uint256_ops::safe_div(
        &prime_field::fpow(&uint256_ops::get_uint256("2"), &ctx[map::MM_LOG_N_STEPS]),
        &uint256_ops::from_usize(stark_params::ECDSA_BUILTIN_RATIO * stark_params::ECDSA_BUILTIN_REPETITIONS)
    );
    let z_point_pow_ecdsa = prime_field::fpow( &oods_point, &n_ecdsa_signature_copy );

    ctx[map::MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__X] = ecdsa_points_x::compute(z_point_pow_ecdsa.clone());
    ctx[map::MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__Y] = ecdsa_points_y::compute(z_point_pow_ecdsa.clone());

    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__PERM__INTERACTION_ELM] = ctx[map::MM_INTERACTION_ELEMENTS].clone();
    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__HASH_INTERACTION_ELM0] = ctx[map::MM_INTERACTION_ELEMENTS + 1].clone();
    ctx[map::MM_RC16__PERM__INTERACTION_ELM] = ctx[map::MM_INTERACTION_ELEMENTS + 2].clone();

    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__PERM__PUBLIC_MEMORY_PROD] = memory_fact_registry::compute_public_memory_quotient(ctx);

    let composition_from_trace_value = polynomial_contrainsts::get_composition_from_trace_val(ctx);

    let claimed_composition = prime_field::fadd(
        ctx[map::MM_OODS_VALUES + stark_params::MASK_SIZE].clone(),
        prime_field::fmul(
            oods_point.clone(), ctx[map::MM_OODS_VALUES + stark_params::MASK_SIZE + 1].clone()
        )
    );

    // ---------  DEBUGGING   -----------
    println!("composition_from_trace_value: {} \n claimed_composition: {}", composition_from_trace_value, claimed_composition);

    //TODO: assert!( composition_from_trace_value == claimed_composition ); //claimedComposition does not match trace
}
/*
    Checks that the trace and the compostion agree at oodsPoint, assuming the prover provided us
    with the proper evaluations.

    Later, we will use boundery constraints to check that those evaluations are actully consistent
    with the commited trace and composition ploynomials.
*/
Checks that the trace and the compostion agree at oodsPoint, assuming the prover provided us
with the proper evaluations.

Later, we will use boundery constraints to check that those evaluations are actully consistent
with the commited trace and composition ploynomials.
Checks that the trace and the compostion agree at oodsPoint assuming the prover provided us with the proper evaluations . Later we will use boundery constraints to check that those evaluations are actully consistent with the commited trace and composition ploynomials .
pub fn oods_consistency_check(ctx: & mut Vec<Uint256>, registry: & HashMap<Uint256, bool>) {
    //Checks that information on memory pages (used from data by prover) is consistent with z, alpha values 
    //TODO: DO we even need it? Uncomment when fixed//memory_fact_registry::verify_memory_page_facts(ctx, registry);
    let oods_point = ctx[map::MM_OODS_POINT].clone();
    //TODO: Test when remix stops tweaking
    println!("oods_point: {}", oods_point);
    // The number of copies in the pedersen hash periodic columns is
    // nSteps / PEDERSEN_BUILTIN_RATIO / PEDERSEN_BUILTIN_REPETITIONS
    let n_penderson_hash_copies = uint256_ops::safe_div(
       &prime_field::fpow(&uint256_ops::get_uint256("2"), &ctx[map::MM_LOG_N_STEPS]), 
        &uint256_ops::from_usize(stark_params::PEDERSEN_BUILTIN_RATIO * stark_params::PEDERSEN_BUILTIN_REPETITIONS)
    );
    let z_point_pow_penderson = prime_field::fpow( &oods_point, &n_penderson_hash_copies );
    ctx[map::MM_PERIODIC_COLUMN__PEDERSEN__POINTS__X] = penderson_hash_x::compute(z_point_pow_penderson.clone());
    ctx[map::MM_PERIODIC_COLUMN__PEDERSEN__POINTS__Y] = penderson_hash_y::compute(z_point_pow_penderson.clone());
    // The number of copies in the ECDSA signature periodic columns is
    // nSteps / ECDSA_BUILTIN_RATIO / ECDSA_BUILTIN_REPETITIONS
    let n_ecdsa_signature_copy = uint256_ops::safe_div(
        &prime_field::fpow(&uint256_ops::get_uint256("2"), &ctx[map::MM_LOG_N_STEPS]),
        &uint256_ops::from_usize(stark_params::ECDSA_BUILTIN_RATIO * stark_params::ECDSA_BUILTIN_REPETITIONS)
    );
    let z_point_pow_ecdsa = prime_field::fpow( &oods_point, &n_ecdsa_signature_copy );
    ctx[map::MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__X] = ecdsa_points_x::compute(z_point_pow_ecdsa.clone());
    ctx[map::MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__Y] = ecdsa_points_y::compute(z_point_pow_ecdsa.clone());
    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__PERM__INTERACTION_ELM] = ctx[map::MM_INTERACTION_ELEMENTS].clone();
    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__HASH_INTERACTION_ELM0] = ctx[map::MM_INTERACTION_ELEMENTS + 1].clone();
    ctx[map::MM_RC16__PERM__INTERACTION_ELM] = ctx[map::MM_INTERACTION_ELEMENTS + 2].clone();
    ctx[map::MM_MEMORY__MULTI_COLUMN_PERM__PERM__PUBLIC_MEMORY_PROD] = memory_fact_registry::compute_public_memory_quotient(ctx);
    let composition_from_trace_value = polynomial_contrainsts::get_composition_from_trace_val(ctx);
    let claimed_composition = prime_field::fadd(
        ctx[map::MM_OODS_VALUES + stark_params::MASK_SIZE].clone(),
        prime_field::fmul(
            oods_point.clone(), ctx[map::MM_OODS_VALUES + stark_params::MASK_SIZE + 1].clone()
        )
    );
    // ---------  DEBUGGING   -----------
    println!("composition_from_trace_value: {} \n claimed_composition: {}", composition_from_trace_value, claimed_composition);
    //TODO: assert!( composition_from_trace_value == claimed_composition ); //claimedComposition does not match trace
}
pub fn oods_consistency_check ( ctx : & mut Vec < Uint256 > , registry : & HashMap < Uint256 , bool > ) { //Checks that information on memory pages (used from data by prover) is consistent with z, alpha values  //TODO: DO we even need it? Uncomment when fixed//memory_fact_registry::verify_memory_page_facts(ctx, registry); let oods_point = ctx [ map :: MM_OODS_POINT ] . clone ( ) ; //TODO: Test when remix stops tweaking println ! ( " " oods_point ) ; // The number of copies in the pedersen hash periodic columns is // nSteps / PEDERSEN_BUILTIN_RATIO / PEDERSEN_BUILTIN_REPETITIONS let n_penderson_hash_copies = uint256_ops :: safe_div ( & prime_field :: fpow ( & uint256_ops :: get_uint256 ( " " ) , & ctx [ map :: MM_LOG_N_STEPS ] ) , & uint256_ops :: from_usize ( stark_params :: PEDERSEN_BUILTIN_RATIO * stark_params :: PEDERSEN_BUILTIN_REPETITIONS ) ) ; let z_point_pow_penderson = prime_field :: fpow ( & oods_point , & n_penderson_hash_copies ) ; ctx [ map :: MM_PERIODIC_COLUMN__PEDERSEN__POINTS__X ] = penderson_hash_x :: compute ( z_point_pow_penderson . clone ( ) ) ; ctx [ map :: MM_PERIODIC_COLUMN__PEDERSEN__POINTS__Y ] = penderson_hash_y :: compute ( z_point_pow_penderson . clone ( ) ) ; // The number of copies in the ECDSA signature periodic columns is // nSteps / ECDSA_BUILTIN_RATIO / ECDSA_BUILTIN_REPETITIONS let n_ecdsa_signature_copy = uint256_ops :: safe_div ( & prime_field :: fpow ( & uint256_ops :: get_uint256 ( " " ) , & ctx [ map :: MM_LOG_N_STEPS ] ) , & uint256_ops :: from_usize ( stark_params :: ECDSA_BUILTIN_RATIO * stark_params :: ECDSA_BUILTIN_REPETITIONS ) ) ; let z_point_pow_ecdsa = prime_field :: fpow ( & oods_point , & n_ecdsa_signature_copy ) ; ctx [ map :: MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__X ] = ecdsa_points_x :: compute ( z_point_pow_ecdsa . clone ( ) ) ; ctx [ map :: MM_PERIODIC_COLUMN__ECDSA__GENERATOR_POINTS__Y ] = ecdsa_points_y :: compute ( z_point_pow_ecdsa . clone ( ) ) ; ctx [ map :: MM_MEMORY__MULTI_COLUMN_PERM__PERM__INTERACTION_ELM ] = ctx [ map :: MM_INTERACTION_ELEMENTS ] . clone ( ) ; ctx [ map :: MM_MEMORY__MULTI_COLUMN_PERM__HASH_INTERACTION_ELM0 ] = ctx [ map :: MM_INTERACTION_ELEMENTS + 1 ] . clone ( ) ; ctx [ map :: MM_RC16__PERM__INTERACTION_ELM ] = ctx [ map :: MM_INTERACTION_ELEMENTS + 2 ] . clone ( ) ; ctx [ map :: MM_MEMORY__MULTI_COLUMN_PERM__PERM__PUBLIC_MEMORY_PROD ] = memory_fact_registry :: compute_public_memory_quotient ( ctx ) ; let composition_from_trace_value = polynomial_contrainsts :: get_composition_from_trace_val ( ctx ) ; let claimed_composition = prime_field :: fadd ( ctx [ map :: MM_OODS_VALUES + stark_params :: MASK_SIZE ] . clone ( ) , prime_field :: fmul ( oods_point . clone ( ) , ctx [ map :: MM_OODS_VALUES + stark_params :: MASK_SIZE + 1 ] . clone ( ) ) ) ; // ---------  DEBUGGING   ----------- println ! ( " \n " composition_from_trace_value claimed_composition ) ; //TODO: assert!( composition_from_trace_value == claimed_composition ); //claimedComposition does not match trace }
Checks that the trace and the compostion agree at oodsPoint, assuming the prover provided us
with the proper evaluations.
Checks that the trace and the compostion agree at oodsPoint assuming the prover provided us with the proper evaluations .
ctx
& mut Vec<Uint256>
registry
& HashMap<Uint256, bool>
ctx
& mut Vec<Uint256>
registry
& HashMap<Uint256, bool>