Skip to content

Commit

Permalink
Use index util funtions outside of crate. (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonh5 authored Jul 11, 2024
1 parent 7fdbdf2 commit 2501444
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/prover/src/core/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ impl<'a, I: Iterator> PeekableExt<'a, I> for Peekable<I> {
}
}

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;
}
Expand All @@ -66,15 +67,18 @@ 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,
) -> usize {
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,
Expand Down

0 comments on commit 2501444

Please sign in to comment.