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

Method get_tz21_ciphertext_and_commitment

proof_system/src/verifier.rs:1863–1876  ·  view source on GitHub ↗

Get the compressed ciphertext and commitment to needed to decrypt message encrypted using DKGitH protocol

(
        &self,
        index: usize,
    )

Source from the content-addressed store, hash-verified

1861
1862 /// Get the compressed ciphertext and commitment to needed to decrypt message encrypted using DKGitH protocol
1863 pub fn get_tz21_ciphertext_and_commitment<D: FullDigest + Digest>(
1864 &self,
1865 index: usize,
1866 ) -> Result<(dkgith_decls::Ciphertext<E::G1Affine>, E::G1Affine), ProofSystemError> {
1867 let st = self.statement_proof(index)?;
1868 if let StatementProof::VeTZ21(s) = st {
1869 let ve_proof = &s.ve_proof;
1870 // TODO: Make Shake256 a generic and ensure it matches the one used on proof generation
1871 let ct = ve_proof.compress::<{ dkgith_decls::SUBSET_SIZE }, D, Shake256>()?;
1872 Ok((ct, s.commitment))
1873 } else {
1874 Err(ProofSystemError::NotAVeTZ21StatementProof)
1875 }
1876 }
1877
1878 /// Get the compressed ciphertext and commitment to needed to decrypt message encrypted using Robust DKGitH protocol
1879 pub fn get_tz21_robust_ciphertext_and_commitment<D: FullDigest + Digest>(

Callers

nothing calls this directly

Calls 1

statement_proofMethod · 0.80

Tested by

no test coverage detected