Commit to a batch of messages and output commitments corresponding to each message.
(
&self,
messages: &[G::ScalarField],
randomness: &[G::ScalarField],
)
| 40 | |
| 41 | /// Commit to a batch of messages and output commitments corresponding to each message. |
| 42 | pub fn commit_to_a_batch( |
| 43 | &self, |
| 44 | messages: &[G::ScalarField], |
| 45 | randomness: &[G::ScalarField], |
| 46 | ) -> Vec<G> { |
| 47 | assert_eq!(messages.len(), randomness.len()); |
| 48 | let g_table = WindowTable::new(messages.len(), self.g.into_group()); |
| 49 | let h_table = WindowTable::new(randomness.len(), self.h.into_group()); |
| 50 | G::Group::normalize_batch( |
| 51 | &cfg_into_iter!(messages) |
| 52 | .zip(cfg_into_iter!(randomness)) |
| 53 | .map(|(m_i, r_i)| &g_table * m_i + &h_table * r_i) |
| 54 | .collect::<Vec<_>>(), |
| 55 | ) |
| 56 | } |
| 57 | |
| 58 | pub fn commit_as_projective( |
| 59 | &self, |
no test coverage detected