Verify the proof of knowledge of MAC. Requires the knowledge of the signer's secret key. It can be seen as composed of 2 parts, one requiring knowledge of secret key and the other not requiring it. The latter can thus be verified by anyone. The former doesn't contain any revealed messages and contains no user specific data.
(
&self,
revealed_msgs: &BTreeMap<usize, G::ScalarField>,
challenge: &G::ScalarField,
secret_key: &SecretKey<G::ScalarField>,
params: &MACParams<G>,
ver
| 490 | /// one requiring knowledge of secret key and the other not requiring it. The latter can thus be verified by anyone. |
| 491 | /// The former doesn't contain any revealed messages and contains no user specific data. |
| 492 | pub fn verify( |
| 493 | &self, |
| 494 | revealed_msgs: &BTreeMap<usize, G::ScalarField>, |
| 495 | challenge: &G::ScalarField, |
| 496 | secret_key: &SecretKey<G::ScalarField>, |
| 497 | params: &MACParams<G>, |
| 498 | verifier_pub_key: Option<&G>, |
| 499 | ) -> Result<(), KVACError> { |
| 500 | if self.B_bar != (self.A_hat * secret_key.0).into() { |
| 501 | return Err(KVACError::InvalidRandomizedMAC); |
| 502 | } |
| 503 | self.verify_common(revealed_msgs, challenge, params, verifier_pub_key)?; |
| 504 | Ok(()) |
| 505 | } |
| 506 | |
| 507 | /// Verify the proof of knowledge of MAC. Doesn't require the knowledge of the signer's secret key |
| 508 | /// but consists of proof of correctness of randomized MAC given by the signer |