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

Method challenges

delegatable_credentials/src/set_commitment.rs:596–615  ·  view source on GitHub ↗
(
        n: u32,
        commitments: &[SetCommitment<E>],
        subsets: &[BTreeSet<E::ScalarField>],
    )

Source from the content-addressed store, hash-verified

594 }
595
596 fn challenges<D: Digest>(
597 n: u32,
598 commitments: &[SetCommitment<E>],
599 subsets: &[BTreeSet<E::ScalarField>],
600 ) -> Vec<E::ScalarField> {
601 le_bytes_iter(n)
602 .zip(commitments)
603 .zip(subsets)
604 .map(|((ctr_bytes, c), s)| {
605 let mut bytes = vec![];
606 bytes.extend_from_slice(&ctr_bytes);
607 c.serialize_compressed(&mut bytes).unwrap();
608 for j in s {
609 j.serialize_compressed(&mut bytes).unwrap()
610 }
611
612 field_elem_from_try_and_incr::<_, D>(&bytes)
613 })
614 .collect()
615 }
616}
617
618// TODO: Add DisjointsetWitness

Callers

nothing calls this directly

Calls 2

le_bytes_iterFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected