MCPcopy Create free account
hub / github.com/docknetwork/crypto / open_subset

Method open_subset

delegatable_credentials/src/set_commitment.rs:304–318  ·  view source on GitHub ↗

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>,
    )

Source from the content-addressed store, hash-verified

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(

Callers 3

checkFunction · 0.80

Calls 3

open_setMethod · 0.80
cloneMethod · 0.80
open_subset_uncheckedMethod · 0.80

Tested by 2