Skip to content

Commit

Permalink
Merge pull request #16261 from MinaProtocol/fix/return-an-option-when…
Browse files Browse the repository at this point in the history
…-an-option-is-asked-for

Fix Lagrange basis performance regression
  • Loading branch information
volhovm authored Oct 21, 2024
2 parents 1d01500 + 6899054 commit 4f78a48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/crypto/kimchi_bindings/wasm/src/srs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ pub mod fp {
domain_size: i32,
i: i32,
) -> Option<WasmPolyComm> {
if !(srs.0.lagrange_bases.contains_key(&(domain_size as usize))) {
return None;
}
let basis = srs.get_lagrange_basis_from_domain_size(domain_size as usize);
Some(basis[i as usize].clone().into())
}
Expand Down Expand Up @@ -330,7 +333,10 @@ pub mod fq {
domain_size: i32,
i: i32,
) -> Option<WasmPolyComm> {
let basis = srs.0.get_lagrange_basis_from_domain_size(domain_size as usize);
if !(srs.0.lagrange_bases.contains_key(&(domain_size as usize))) {
return None;
}
let basis = srs.get_lagrange_basis_from_domain_size(domain_size as usize);
Some(basis[i as usize].clone().into())
}

Expand Down

0 comments on commit 4f78a48

Please sign in to comment.