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 c2780f7 commit 10a3f69
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

1 comment on commit 10a3f69

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 10a3f69 Previous: cd8b37b Ratio
iffts/simd ifft/22 13328036 ns/iter (± 187760) 6306399 ns/iter (± 210024) 2.11
merkle throughput/simd merkle 29913240 ns/iter (± 554053) 13712527 ns/iter (± 579195) 2.18

This comment was automatically generated by workflow using github-action-benchmark.

CC: @shaharsamocha7

Please sign in to comment.