Skip to content

Commit

Permalink
Ensure we update highest_degree_bound
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsn committed Nov 27, 2023
1 parent 2be8d08 commit 07b7f08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions algorithms/src/polycommit/sonic_pc/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl<E: PairingEngine> CommitterKey<E> {

// Retrieve current degree bounds and shifted powers
let degree_bounds = self.enforced_degree_bounds.take().unwrap_or_default();
let highest_degree_bound = degree_bounds.iter().copied().sorted().last().unwrap_or_default();
let mut highest_degree_bound = degree_bounds.iter().copied().sorted().last().unwrap_or_default();
let mut shifted_powers_of_beta_g = self.shifted_powers_of_beta_g.take().unwrap_or_default();
let mut shifted_powers_of_beta_times_gamma_g =
self.shifted_powers_of_beta_times_gamma_g.take().unwrap_or_default();
Expand All @@ -325,7 +325,8 @@ impl<E: PairingEngine> CommitterKey<E> {
// This is because the proof system assumes we need this extra degree.
// This can optionally be refactored to ensure the extra degree is already encoded in degree_bounds.
if highest_degree_bound > 0 {
highest_degree_bound.checked_add(1).ok_or(error("Overflow highest_degree_bound"))?;
highest_degree_bound =
highest_degree_bound.checked_add(1).ok_or(error("Overflow highest_degree_bound"))?;
}

let shifted_ck_time = start_timer!(|| "Constructing `shifted_powers_of_beta_g`");
Expand Down

0 comments on commit 07b7f08

Please sign in to comment.