Same as `Self::open_subset_unchecked` but additionally checks if the subset is indeed a subset and the opening is valid.
(
&self,
opening: &SetCommitmentOpening<E>,
subset: BTreeSet<E::ScalarField>,
set: BTreeSet<E::ScalarField>,
srs: &SetCommitmentSRS<E>,
)
| 302 | |
| 303 | /// Same as `Self::open_subset_unchecked` but additionally checks if the subset is indeed a subset and the opening is valid. |
| 304 | pub fn open_subset( |
| 305 | &self, |
| 306 | opening: &SetCommitmentOpening<E>, |
| 307 | subset: BTreeSet<E::ScalarField>, |
| 308 | set: BTreeSet<E::ScalarField>, |
| 309 | srs: &SetCommitmentSRS<E>, |
| 310 | ) -> Result<SubsetWitness<E>, DelegationError> { |
| 311 | if !subset.is_subset(&set) { |
| 312 | return Err(DelegationError::NotASubset); |
| 313 | } |
| 314 | // Check if the opening is correct |
| 315 | self.open_set(opening, set.clone(), srs)?; |
| 316 | |
| 317 | self.open_subset_unchecked(opening, subset, set, srs) |
| 318 | } |
| 319 | |
| 320 | /// Returns witness for the given subset of a set which is committed in this commitment |
| 321 | pub fn open_subset_unchecked( |