Skip to content

Commit 1d80589

Browse files
committed
moving the value rather than reading the reference
1 parent 2d0d309 commit 1d80589

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

pcs/src/orion/pcs_impl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl OrionPublicParams {
194194
let mut eval_row = vec![EvalF::ZERO; msg_size];
195195

196196
let eq_col_coeffs = EqPolynomial::build_eq_x_r(&point[num_of_vars_in_msg..]);
197-
luts.build(&eq_col_coeffs);
197+
luts.build(eq_col_coeffs);
198198

199199
packed_evals
200200
.chunks(row_num / OpenPackF::PACK_SIZE)
@@ -208,7 +208,7 @@ impl OrionPublicParams {
208208

209209
proximity_rows.iter_mut().for_each(|row_buffer| {
210210
let random_coeffs = transcript.generate_challenge_field_elements(row_num);
211-
luts.build(&random_coeffs);
211+
luts.build(random_coeffs);
212212

213213
packed_evals
214214
.chunks(row_num / OpenPackF::PACK_SIZE)
@@ -326,9 +326,9 @@ impl OrionPublicParams {
326326

327327
let eq_linear_combination = EqPolynomial::build_eq_x_r(&point[num_of_vars_in_msg..]);
328328
random_linear_combinations
329-
.iter()
329+
.into_iter()
330330
.zip(proof.proximity_rows.iter())
331-
.chain(iter::once((&eq_linear_combination, &proof.eval_row)))
331+
.chain(iter::once((eq_linear_combination, &proof.eval_row)))
332332
.all(|(rl, msg)| {
333333
let codeword = match self.code_instance.encode(msg) {
334334
Ok(c) => c,

pcs/src/orion/tests.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ use crate::orion::{
1111
utils::{transpose_in_place, SubsetSumLUTs, TensorIOPPCS},
1212
};
1313

14-
fn column_combination<F, PackF>(mat: &[F], combination: &[F]) -> Vec<F>
14+
fn column_combination<F, PackF>(mat: &[F], combination: Vec<F>) -> Vec<F>
1515
where
1616
F: Field,
1717
PackF: SimdField<Scalar = F>,
1818
{
1919
assert_eq!(combination.len() % PackF::PACK_SIZE, 0);
20+
let combination_len = combination.len();
2021

2122
let mut luts = SubsetSumLUTs::new(PackF::PACK_SIZE, combination.len() / PackF::PACK_SIZE);
2223
luts.build(combination);
2324

24-
mat.chunks(combination.len())
25+
mat.chunks(combination_len)
2526
.map(|p_col| {
2627
let packed: Vec<_> = p_col.chunks(PackF::PACK_SIZE).map(PackF::pack).collect();
2728
luts.lookup_and_sum(&packed)
@@ -63,8 +64,8 @@ where
6364
drop(codeword_scratch);
6465

6566
// NOTE: message and codeword matrix linear combination with weights
66-
let msg_linear_combined = column_combination::<F, PackF>(&message_mat, &weights);
67-
let codeword_linear_combined = column_combination::<F, PackF>(&codeword_mat, &weights);
67+
let msg_linear_combined = column_combination::<F, PackF>(&message_mat, weights.clone());
68+
let codeword_linear_combined = column_combination::<F, PackF>(&codeword_mat, weights);
6869

6970
let codeword_computed = orion_code.encode(&msg_linear_combined).unwrap();
7071

pcs/src/orion/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ pub trait TensorIOPPCS {
7777
// NOTE: use Ligero (AHIV22) or Avg-case dist to a code (BKS18)
7878
// version of avg case dist in unique decoding technique.
7979
// Here is the probability union bound
80-
let code_len_over_f_bits = F::FIELD_SIZE - self.codeword_len().ilog2() as usize;
80+
let single_run_soundness_bits = F::FIELD_SIZE - self.codeword_len().ilog2() as usize;
8181

82-
(soundness_bits as f64 / code_len_over_f_bits as f64).ceil() as usize
82+
(soundness_bits as f64 / single_run_soundness_bits as f64).ceil() as usize
8383
}
8484
}
8585

@@ -104,7 +104,7 @@ impl<F: Field> SubsetSumLUTs<F> {
104104
}
105105

106106
#[inline]
107-
pub fn build(&mut self, weights: &[F]) {
107+
pub fn build(&mut self, weights: Vec<F>) {
108108
assert_eq!(weights.len() % self.entry_bits, 0);
109109
assert_eq!(weights.len() / self.entry_bits, self.tables.len());
110110

0 commit comments

Comments
 (0)