From 835766b31f91c3809dbb5c6a4fb6cc9325ec2489 Mon Sep 17 00:00:00 2001 From: Alon Haramati Date: Wed, 10 Jul 2024 16:32:26 +0300 Subject: [PATCH] Use index util funtions outside of crate. --- crates/prover/src/core/utils.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/prover/src/core/utils.rs b/crates/prover/src/core/utils.rs index 2105a4d81..56dc54eb3 100644 --- a/crates/prover/src/core/utils.rs +++ b/crates/prover/src/core/utils.rs @@ -56,7 +56,8 @@ impl<'a, I: Iterator> PeekableExt<'a, I> for Peekable { } } -pub(crate) fn bit_reverse_index(i: usize, log_size: u32) -> usize { +/// Returns the bit reversed index of `i` which is represented by `log_size` bits. +pub fn bit_reverse_index(i: usize, log_size: u32) -> usize { if log_size == 0 { return i; } @@ -66,7 +67,7 @@ pub(crate) fn bit_reverse_index(i: usize, log_size: u32) -> usize { /// Returns the index of the previous element in a bit reversed /// [super::poly::circle::CircleEvaluation] of log size `eval_log_size` relative to a smaller domain /// of size `domain_log_size`. -pub(crate) fn previous_bit_reversed_circle_domain_index( +pub fn previous_bit_reversed_circle_domain_index( i: usize, domain_log_size: u32, eval_log_size: u32, @@ -74,7 +75,10 @@ pub(crate) fn previous_bit_reversed_circle_domain_index( offset_bit_reversed_circle_domain_index(i, domain_log_size, eval_log_size, -1) } -pub(crate) fn offset_bit_reversed_circle_domain_index( +/// Returns the index of the offset element in a bit reversed +/// [super::poly::circle::CircleEvaluation] of log size `eval_log_size` relative to a smaller domain +/// of size `domain_log_size`. +pub fn offset_bit_reversed_circle_domain_index( i: usize, domain_log_size: u32, eval_log_size: u32,