Skip to content

Commit

Permalink
Delete shifted_secure_combination Function
Browse files Browse the repository at this point in the history
  • Loading branch information
Gali-StarkWare committed Dec 10, 2024
1 parent 2798020 commit de223b0
Showing 1 changed file with 1 addition and 14 deletions.
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

0 comments on commit de223b0

Please sign in to comment.