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

Method get_resp_for_message

bbs_plus/src/proof.rs:447–461  ·  view source on GitHub ↗

Get the response from post-challenge phase of the Schnorr protocol for the given message index `msg_idx`. Used when comparing message equality

(
        &self,
        msg_idx: usize,
        revealed_msg_ids: &BTreeSet<usize>,
    )

Source from the content-addressed store, hash-verified

445 /// Get the response from post-challenge phase of the Schnorr protocol for the given message index
446 /// `msg_idx`. Used when comparing message equality
447 pub fn get_resp_for_message(
448 &self,
449 msg_idx: usize,
450 revealed_msg_ids: &BTreeSet<usize>,
451 ) -> Result<&E::ScalarField, BBSPlusError> {
452 let adjusted_idx = msg_index_to_schnorr_response_index(msg_idx, revealed_msg_ids)
453 .ok_or_else(|| BBSPlusError::InvalidMsgIdxForResponse(msg_idx))?;
454 if let Some(resp) = self.sc_resp_2.as_ref() {
455 Ok(resp.get_response(adjusted_idx)?)
456 } else if let Some(resp) = self.sc_partial_resp_2.as_ref() {
457 Ok(resp.get_response(adjusted_idx)?)
458 } else {
459 Err(BBSPlusError::NeedEitherPartialOrCompleteSchnorrResponse)
460 }
461 }
462
463 pub fn get_responses(
464 &self,

Calls 3

as_refMethod · 0.45
get_responseMethod · 0.45

Tested by

no test coverage detected