Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use index util funtions outside of crate. #719

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading