barustenberg
barustenberg copied to clipboard
close #79
Description
All major changes were done in src/plonk/proof_system/commitment_scheme.rs
.
- Implement the tests outlined in #79, namely
test_kate_open
andkate_batch_open
. - Fix the locks on line 370
No more progress can be made until transcripts are implemented.
Link to issue
Type of change
- [x] Bug fix (non-breaking change that fixes an issue)
Test plan (required)
Tests implemented:
- [ ]
test_kate_open
- [ ]
kate_batch_open
The latter of the two tests covers the change in batch_open
pertaining to the locks.
Miscellaneous
Per the suggestion, the write locks in batch_open
were bypassed by arcs and unsafe code. Arc cloning is cheap and enables concurrent writes to consecutive memory addresses:
(0..input_key.small_domain.size)
.into_par_iter()
.for_each(|i| unsafe {
let mut opening_poly = (opening_poly.clone().coefficients.as_ptr() as *mut Fr).offset(i as isize);
let mut shifted_opening_poly = (shifted_opening_poly.clone().coefficients.as_ptr() as *mut Fr).offset(i as isize);
*opening_poly = input_key.quotient_polynomial_parts[0].read().unwrap()[i];
for &(ref poly, challenge) in &opened_polynomials_at_zeta {
*opening_poly += (*poly).read().unwrap()[i] * challenge;
}
*shifted_opening_poly = Fr::zero();
for &(ref poly, challenge) in &opened_polynomials_at_zeta_omega {
*shifted_opening_poly += (*poly).read().unwrap()[i] * challenge;
}
});