fn init_fri_groups(fri_ctx: usize, ctx: & mut Vec<Uint256>) {
	let fri_group_idx = fri_ctx + FRI_CTX_TO_FRI_GROUP_OFFSET;
	let fri_half_inv_group_idx = fri_ctx + FRI_CTX_TO_FRI_HALF_INV_GROUP_OFFSET;

	// FRI_GROUP_GEN is the coset generator.
	// Raising it to the (MAX_COSET_SIZE - 1) power gives us the inverse
	let gen_fri_group = uint256_ops::get_uint256(FRI_GROUP_GEN);

	let gen_fri_group_inv = prime_field::fpow( &gen_fri_group, &uint256_ops::from_usize(MAX_COSET_SIZE - 1) );

	ctx[fri_half_inv_group_idx] = uint256_ops::get_uint256("1");
	ctx[fri_group_idx] = uint256_ops::get_uint256("1");
	ctx[fri_group_idx + 1] = prime_field::get_k_modulus() - uint256_ops::get_uint256("1"); //PRIME - 1s

	let mut last_val = uint256_ops::get_uint256("1");
	let mut last_val_inv = uint256_ops::get_uint256("1"); 

	// To compute [1, -1 (== g^n/2), g^n/4, -g^n/4, ...]
	// we compute half the elements and derive the rest using negation.
	for i in 1..MAX_COSET_SIZE/2 {
		last_val = prime_field::fmul(last_val.clone(), gen_fri_group.clone()); //Should be for first iteration: 2679026602897868112349604024891625875968950767352485125058791696935099163961, 
		last_val_inv = prime_field::fmul(last_val_inv.clone(), gen_fri_group_inv.clone()); //Should be for first iteration: 2607735469685256064975697808597423000021425046638838630471627721324227832437, 
		
		let idx = bit_reverse( uint256_ops::from_usize(i), FRI_MAX_FRI_STEP-1);

		ctx[fri_half_inv_group_idx + idx] = last_val_inv.clone();
		ctx[fri_group_idx + 2*idx] = last_val.clone();
		ctx[fri_group_idx + 2*idx + 1] = prime_field::get_k_modulus() - last_val.clone();

	}
}
/*
	Initializes the FRI group and half inv group in the FRI context.
*/
Initializes the FRI group and half inv group in the FRI context.
Initializes the FRI group and half inv group in the FRI context .
fn init_fri_groups(fri_ctx: usize, ctx: & mut Vec<Uint256>) {
	let fri_group_idx = fri_ctx + FRI_CTX_TO_FRI_GROUP_OFFSET;
	let fri_half_inv_group_idx = fri_ctx + FRI_CTX_TO_FRI_HALF_INV_GROUP_OFFSET;
	// FRI_GROUP_GEN is the coset generator.
	// Raising it to the (MAX_COSET_SIZE - 1) power gives us the inverse
	let gen_fri_group = uint256_ops::get_uint256(FRI_GROUP_GEN);
	let gen_fri_group_inv = prime_field::fpow( &gen_fri_group, &uint256_ops::from_usize(MAX_COSET_SIZE - 1) );
	ctx[fri_half_inv_group_idx] = uint256_ops::get_uint256("1");
	ctx[fri_group_idx] = uint256_ops::get_uint256("1");
	ctx[fri_group_idx + 1] = prime_field::get_k_modulus() - uint256_ops::get_uint256("1"); //PRIME - 1s
	let mut last_val = uint256_ops::get_uint256("1");
	let mut last_val_inv = uint256_ops::get_uint256("1"); 
	// To compute [1, -1 (== g^n/2), g^n/4, -g^n/4, ...]
	// we compute half the elements and derive the rest using negation.
	for i in 1..MAX_COSET_SIZE/2 {
		last_val = prime_field::fmul(last_val.clone(), gen_fri_group.clone()); //Should be for first iteration: 2679026602897868112349604024891625875968950767352485125058791696935099163961, 
		last_val_inv = prime_field::fmul(last_val_inv.clone(), gen_fri_group_inv.clone()); //Should be for first iteration: 2607735469685256064975697808597423000021425046638838630471627721324227832437, 
		let idx = bit_reverse( uint256_ops::from_usize(i), FRI_MAX_FRI_STEP-1);
		ctx[fri_half_inv_group_idx + idx] = last_val_inv.clone();
		ctx[fri_group_idx + 2*idx] = last_val.clone();
		ctx[fri_group_idx + 2*idx + 1] = prime_field::get_k_modulus() - last_val.clone();
	}
}
fn init_fri_groups ( fri_ctx : usize , ctx : & mut Vec < Uint256 > ) { let fri_group_idx = fri_ctx + FRI_CTX_TO_FRI_GROUP_OFFSET ; let fri_half_inv_group_idx = fri_ctx + FRI_CTX_TO_FRI_HALF_INV_GROUP_OFFSET ; // FRI_GROUP_GEN is the coset generator. // Raising it to the (MAX_COSET_SIZE - 1) power gives us the inverse let gen_fri_group = uint256_ops :: get_uint256 ( FRI_GROUP_GEN ) ; let gen_fri_group_inv = prime_field :: fpow ( & gen_fri_group , & uint256_ops :: from_usize ( MAX_COSET_SIZE - 1 ) ) ; ctx [ fri_half_inv_group_idx ] = uint256_ops :: get_uint256 ( " " ) ; ctx [ fri_group_idx ] = uint256_ops :: get_uint256 ( " " ) ; ctx [ fri_group_idx + 1 ] = prime_field :: get_k_modulus ( ) - uint256_ops :: get_uint256 ( " " ) ; //PRIME - 1s let mut last_val = uint256_ops :: get_uint256 ( " " ) ; let mut last_val_inv = uint256_ops :: get_uint256 ( " " ) ; // To compute [1, -1 (== g^n/2), g^n/4, -g^n/4, ...] // we compute half the elements and derive the rest using negation. for i in 1 .. MAX_COSET_SIZE / 2 { last_val = prime_field :: fmul ( last_val . clone ( ) , gen_fri_group . clone ( ) ) ; //Should be for first iteration: 2679026602897868112349604024891625875968950767352485125058791696935099163961,  last_val_inv = prime_field :: fmul ( last_val_inv . clone ( ) , gen_fri_group_inv . clone ( ) ) ; //Should be for first iteration: 2607735469685256064975697808597423000021425046638838630471627721324227832437,  let idx = bit_reverse ( uint256_ops :: from_usize ( i ) , FRI_MAX_FRI_STEP - 1 ) ; ctx [ fri_half_inv_group_idx + idx ] = last_val_inv . clone ( ) ; ctx [ fri_group_idx + 2 * idx ] = last_val . clone ( ) ; ctx [ fri_group_idx + 2 * idx + 1 ] = prime_field :: get_k_modulus ( ) - last_val . clone ( ) ; } }
Initializes the FRI group and half inv group in the FRI context.
Initializes the FRI group and half inv group in the FRI context .
fri_ctx
usize
ctx
& mut Vec<Uint256>
fri_ctx
usize
ctx
& mut Vec<Uint256>