Build a map of blindings for witnesses of given the statement index. The key is the witness index and value is the blinding. Also removes that blinding from the global blindings map containing blinding for each witness reference.
(
blindings: &mut BTreeMap<WitnessRef, E::ScalarField>,
s_idx: usize,
wit_idx: impl Iterator<Item = usize>,
)
| 282 | /// index and value is the blinding. Also removes that blinding from the global blindings map |
| 283 | /// containing blinding for each witness reference. |
| 284 | fn build_blindings_map<E: Pairing>( |
| 285 | blindings: &mut BTreeMap<WitnessRef, E::ScalarField>, |
| 286 | s_idx: usize, |
| 287 | wit_idx: impl Iterator<Item = usize>, |
| 288 | ) -> BTreeMap<usize, E::ScalarField> { |
| 289 | let mut blindings_map = BTreeMap::new(); |
| 290 | for k in wit_idx { |
| 291 | match blindings.remove(&(s_idx, k)) { |
| 292 | Some(b) => blindings_map.insert(k, b), |
| 293 | None => None, |
| 294 | }; |
| 295 | } |
| 296 | blindings_map |
| 297 | } |
| 298 | |
| 299 | // Initialize sub-protocols for each statement |
| 300 | for (s_idx, (statement, witness)) in proof_spec |