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

Gali - Delete shifted_secure_combination Function #928

Merged
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
15 changes: 1 addition & 14 deletions crates/prover/src/core/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::iter::Peekable;
use std::ops::{Add, Mul, Sub};

use num_traits::{One, Zero};
use num_traits::One;

use super::fields::m31::BaseField;
use super::fields::qm31::SecureField;
Expand Down Expand Up @@ -175,18 +174,6 @@ pub fn generate_secure_powers(felt: SecureField, n_powers: usize) -> Vec<SecureF
.collect()
}

/// Securely combines the given values using the given random alpha and z.
/// Alpha and z should be secure field elements for soundness.
pub fn shifted_secure_combination<F: Copy, EF>(values: &[F], alpha: EF, z: EF) -> EF
where
EF: Copy + Zero + Mul<EF, Output = EF> + Add<F, Output = EF> + Sub<EF, Output = EF>,
{
let res = values
.iter()
.fold(EF::zero(), |acc, &value| acc * alpha + value);
res - z
}

#[cfg(test)]
mod tests {
use itertools::Itertools;
Expand Down
Loading