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

Method commit_to_messages

kvac/src/bbs_sharp/setup.rs:106–123  ·  view source on GitHub ↗
(
        &self,
        indexed_messages_sorted_by_index: MI,
    )

Source from the content-addressed store, hash-verified

104 }
105
106 pub fn commit_to_messages<'a, MI>(
107 &self,
108 indexed_messages_sorted_by_index: MI,
109 ) -> Result<G, KVACError>
110 where
111 MI: IntoIterator<Item = (usize, &'a G::ScalarField)>,
112 {
113 let (bases, scalars): (Vec<_>, Vec<_>) = process_results(
114 pair_valid_items_with_slice::<_, _, _, KVACError, _>(
115 indexed_messages_sorted_by_index,
116 CheckLeft(seq_pairs_satisfy(|a, b| a < b)),
117 &self.g_vec,
118 ),
119 |iter| iter.unzip(),
120 )?;
121
122 Ok(G::Group::msm_unchecked(&bases, &scalars).into_affine())
123 }
124
125 /// Used to create whats called `B` in the paper. `B = g_0 + user_public_key + \sum_i{g_i * m_i}`
126 pub fn b<'a, MI>(

Callers 1

bMethod · 0.45

Calls 2

CheckLeftClass · 0.85
seq_pairs_satisfyFunction · 0.85

Tested by

no test coverage detected